11 Apr 2016

A New Understanding of Depression And How to Fixing Broken Brain

Fixing broken brains: a new understanding of depression

Untreatable depression is on the rise, hinting at fundamental flaws in our understanding of the illness. But new treatments offer hope for everyone
Fixing broken brains: a new understanding of depression
(Image: Michael Glenwood)
ONE OF Vanessa Price’s first chronic cases involved a woman we’ll call Paula. Paula came to the London Psychiatry Centre, where Price is a registered nurse, after two years of unrelenting depression. First she stopped seeing her friends. Then she stopped getting out of bed. Finally, she began cutting herself. Sessions with a psychiatrist didn’t help, nor did medication. In fact, they made it worse. Paula had joined the ranks of people diagnosed with treatment-resistant depression.
The steady rise in this diagnosis over the past two decades reflects a little-known trend. The effectiveness of some antidepressant drugs has been overstated, so much so that some pharmaceutical companies have stopped researching them altogether.
The stubborn nature of these cases of depression has, however, spurred research into new and sometimes unorthodox treatments. Surprising and impressive results suggest that we have fundamentally misunderstood the disorder.
In fact, the new research has opened the door to thinking about depression not as a single condition but as a continuum of illnesses, all with different underlying neurological mechanisms, which may hold clues to lasting relief. This promise has sparked a renaissance in drug development not seen since the 1950s.
Depression is an illness whose brutality is matched only by its perverseness. Estimates vary, but it is likely that close to one in six of us can expect to struggle with it at some point in our lives. The symptoms are cruel – including insomnia, hopelessness, loss of interest in life, chronic exhaustion and even an increased risk of ailments such as heart disease. Depression also leads people to cut themselves off from others, a tendency exacerbated further by the continuing stigma surrounding the condition, thought to deter over half of depressed people from seeking treatment. Untreated, depression can lead to suicide; the World Health Organization estimates there is one suicide every 40 seconds. These factors all contribute to the WHO’s assessment of depression as the leading cause of disability in the world.
What causes people to become depressed? The dominant theory is that depression results from a chemical imbalance in the brain, with the neurotransmitter serotonin as the prime suspect. Many trials have linked depression to low levels of serotonin, something that was thought to disrupt the brain’s ability to pass messages across synapses, the tiny gaps between neurons.

Mysterious decline

The theory was that a boost in serotonin should return neural signalling and mood to normal levels. The first drug based on the serotonin hypothesis – fluoxetine, better known as Prozac – was launched in the late 1980s, and nearly all subsequent antidepressants have operated on the same general principle: keep levels of serotonin high by preventing the brain from reabsorbing and recycling it.
Though such drugs remain the go-to tools for lifting depression, however, they seem to be getting less effective (see False dawn). Clinical trials in the 1980s and 1990s indicated that these drugs would help 80 to 90 per cent of depressed people go into remission. But studies in the 2000s showed that standard antidepressants work only in 60 to 70 per cent of people, a decline that was underscored in 2006 when the National Institute of Mental Health (NIMH) in Bethesda, Maryland published the results of a massive, nationwide clinical trial. Unlike many pharmaceutical trials – which often screen out certain participants – this was the first to measure the effectiveness of antidepressants in a population representative of the real world. The results were disquieting: few of the 2876 participants fully recovered without switching to or in many cases adding other medications.
What can explain this apparent decline in the potency of antidepressants? Perhaps the drugs themselves were never quite as effective as claimed. To approve a given antidepressant, the US Food and Drug Administration only requires two large-scale studies to verify that the drug is superior to a placebo. However, pharmaceutical companies are under no obligation to supply the FDA with every study they have conducted; only the positive ones.
When David Mischoulon, director of psychiatry research at Massachusetts General Hospital in Boston, sifted through previously unpublished data from pharmaceutical trials, he says he found many more negative results than positive ones: a high percentage of studies showed that the drugs were only slightly better than the placebo. “Now we think it’s more in the neighbourhood of 50 per cent of people who may respond to a given antidepressant,” Mischoulon says. So the rise of treatment-resistant depression might be a reflection of the time it has taken doctors to see that reality reflected in their clinics.
The next question then is why – could the drugs’ failure be down to a problem in our understanding of the underlying mechanism? After all, untreatable depression wasn’t the only inconsistency to cast doubt on the serotonin hypothesis. A 2007 study, for example, showed that serotonin levels in the brains of depressed people not receiving treatment were double those in volunteers who were not depressed.
In the wake of this confusion, several pharmaceutical companies decided to stop their work on mood disorders altogether. GlaxoSmithKline – the company that makes the well-known antidepressants Paxil and Wellbutrin – announced in 2010 that it would halt research into depression.
Without new drugs to help the growing number of people whose depression seemed incurable, clinicians found themselves in a bind. “We got used to telling our patients to hang in there,” says Carlos Zarate, a neurobiologist who directs research on mood disorders at NIMH. While they waited for a drug to start working, doctors relied on intense and frequent therapy to ensure depressed people didn’t lose their jobs or attempt suicide. That strategy wasn’t always effective. “I felt like a failure,” Paula says. After nothing worked, she took an overdose of sleeping pills. It wasn’t that she wanted to die, she says; she simply didn’t care if she lived or not.

Last resort

Desperate to help their charges, some frustrated clinicians began to look for new therapies. Their investigations were all over the map: electrical and magnetic brain stimulation, and a veterinary tranquilliser known as ketamine. But they worked.
After drug treatment and behavioural therapy failed, what saved Paula was a groundbreaking therapy called repetitive transcranial magnetic stimulation (rTMS). It was the stuff of movies. Paula would put a cap on her head and sit under a big machine for about 20 minutes while a brief electric current passed through a small coil positioned a few inches above her left temple, creating a fleeting high-intensity magnetic pulse.
After 15 sessions, Paula stopped wanting to hurt herself. Getting out of bed began to seem like a good idea. When her friends dragged her to a concert, she was surprised to find herself enjoying it. “That would have been unthinkable before,” she says.
“After 15 sessions of magnetic stimulation, getting out of bed began to seem like a good idea to Paula”
Price was surprised. “I have to be honest, I was dubious,” she says. “But I am absolutely stunned by the results.” Since the start of this year, she has successfully treated 10 other people there using rTMS. Price’s experience is reflected in a growing body of research over the past few years, which finds that rTMS seems particularly effective against treatment-resistant depression. In one study, it benefited 12 out of a group of 28 people for whom nothing else had worked.
At the moment, rTMS treatment is not cheap. In the UK, the procedure is not available on the National Health Service, so the people treated at Price’s clinic have to shell out £6000. Australia’s Medical Services Advisory Committee have decided there is insufficient evidence that rTMS works and so have declined to fund such treatments.
In the US, some clinicians have turned to a more affordable option that shows similar promise: cranial electrical stimulation. It simply involves delivering a tiny current with two electrodes strapped to the head using a sweatband. Unlike rTMS equipment, which is bulky, this device is roughly the size of a deck of cards and is available with a prescription.
Stephen Xenakis, a doctor who is also a retired general and a former adviser to the US Department of Defense, uses the device not only on his patients, but also on himself. He asks his patients to use it 20 minutes at a time, twice a day. “Sometimes this can help in ways that the medications don’t,” he says. “The thing I’ve seen it help most with is insomnia and anxiety,” conditions which both fuel, and are fuelled by, treatment-resistant depression.
But the most promising option in terms of convenience could be the drug ketamine. As early as 2000 a study of eight people with long-standing, untreatable depression suggested that a single dose of ketamine, given intravenously, would almost immediately lift symptoms.
Several studies have replicated the results. In the largest clinical trial to date, involving 72 participants, researchers from the Icahn School of Medicine at Mount Sinai in New York, found that people who’d failed to respond to any other treatments experienced relief from suicidal thoughts when given ketamine intravenously for 40 minutes. Zarate says that a growing body of research suggests the drug could work for 60 per cent of patients. “Some people go into remission within a day,” he says, and can remain free from depression for up to 10 days.
But what mechanisms might explain the success of a seemingly unrelated group of treatments where traditional ones had failed? When researchers began to piece together the results, the link they found was glutamate.
Glutamate is the most dominant stimulatory neurotransmitter in the brain, playing a key role in learning, motivation, memory and plasticity. Some researchers think that levels of glutamate, like serotonin, are too low in the depressed person’s brain.
But that’s where the similarity ends. Rather than simply aiding in the transport of messages between neurons, glutamate may be a factor in helping the brain’s neurons repair themselves. This would dovetail with a theory of depression that has gained a significant following in recent years: that depression causes some dendrites – message-relaying “fingers” at the ends of neurons – to shrivel. The synapses become like broken bridges, with messages unable to cross between the affected neurons. Among other evidence to support this theory is the finding that each successive episode of depression seems to leave people more vulnerable to a subsequent episode (see graph).
The ketamine trials were the first clue that glutamate might help. Ketamine sets off a complex chain reaction. First, it blocks the specific receptors that glutamate binds to, releasing a tide of the chemical into synapses. That leads to an increase in a protein called brain-derived neurotrophic factor which, animal studies show, causes the dendrites to sprout new spines, helping them to receive messages from neighbouring neurons.
When Ronald Duman of Yale University injected rats with ketamine, he saw a burst of glutamate in rodents’ prefrontal cortex – along with a fast increase in the formation of new synapses. Other studies show that rTMS alsoraises glutamate levels to cause similar structural effects.
Instead of enabling a broken brain to pass on messages in spite of damage, then, glutamate may be teaching a depressed brain how to rebuild itself. The feeling, Zarate says, is that in some cases, depression may be better explained as a disorder of neuron structure than being due to a chemical imbalance. But that doesn’t necessarily mean serotonin is out of the picture.
“I don’t think we were wrong,” says Mischoulon. “I think we didn’t have the whole story.” The Diagnostic and Statistical Manual of Mental Disorders, the bible of psychiatry in the US, already subdivides depression into categories, including postnatal and bipolar, but it considers their underlying neurophysiological mechanisms to be the same. The new research could change that. “We’re now thinking that there are probably a wide continuum of illnesses lumped together under the heading of depression,” he says, with either glutamate or serotonin as the culprit.

New beginnings

If so, how will individuals know which type of depression they have? One way to find out would be to see which drugs are effective. “If you don’t get a response from ketamine the first day, you probably never will,” says Zarate. Work to develop a diagnostic test is already under way. “We’re trying to identify certain factors in the blood associated with certain subtypes of depression,” says Mischoulon. Brain scans are another possibility: these can already show whether a person will respond better to talk therapy or medication.
All this research is still very much in its infancy, but well before biomarker tests arrive, there should be a raft of new medications that exploit glutamate to combat depression. At least five companies have been working on ketamine derivatives. One example is GLYX-13, which showed promise in preclinical trials earlier this year. AstraZeneca, Roche and Janssen, among others, are also developing both pills and intravenous drugs, the first of which should be with us within a couple of years. Zarate says some pharmaceutical companies are even focusing on glutamate drugs for first line use rather than as a last-resort treatment for depression.
One tantalising possibility remains. If glutamate affects neuroplasticity, could that lead to lasting structural changes in the brain? George Aghajanian at Yale, whose seminal work inspired all the ketamine investigations, says that in people predisposed to recurring depression, ketamine may help neurons permanently maintain new and thicker connections. In recent work on rats, he found that the drug, when combined with other compounds, “leads to long-term structural repairs in the brain”, he says. But whether the same is true in humans will require much further study.
Whatever the future holds, glutamate – and the new possibilities it has raised – has at least enabled us to start thinking about depression in a different way. That is rare in the troubled waters of psychiatry.

The birth of the photograph - William Henry FoxTalbot

William Henry Fox Talbot and the birth of the photograph

Fox Talbot
William Henry Fox Talbot and Nicolaas Henneman at the Reading establishment, 1846
HE WAS a man of some accomplishments, but drawing eluded him. So while on honeymoon in Italy in 1833, William Henry Fox Talbot adopted the camera lucida, a tracing device, to help him sketch scenes. “The idea occurred to me,” he later wrote, “how charming it would be if it were possible to cause these natural images to imprint themselves durably, and remain fixed upon the paper.”
Although not the first to develop a photographic process (the Frenchman Louis Daguerre is usually handed those laurels), Talbot remains the godfather of the modern “art of fixing a shadow”. His first photographs highlighted the precision and fine grain of the new medium. Later work is wittier and more domestic, as by then Talbot had developed photography as an art for everyone. His company in Reading, UK, mass-produced paper prints from his calotype negatives. It also made prints from others’ negatives, copied artwork and documents, and took portraits.
In 1934, Talbot’s niece Matilda passed on 6500 items of his to London’s Science Museum. From 14 April a new exhibition, Dawn of the Photograph, presents the best of these, including fragile early experiments in the art.
Fox Talbot
William Henry Fox Talbot and Nicolaas Henneman at the Reading establishment, 1846

latticed window
The Latticed Window (with the Camera Obscura), August 1835

ladder
The Ladder, April 1844

English vine
The English Vine (Bryonia Dioica), probably 1839

Melrose Abbey
Melrose Abbey, 1844
credit for all pictures: William Henry Fox Talbot © National Media Museum, Bradford / Science & Society Picture Library

10 Apr 2016

What is a DLL ?

What is a DLL ?

A DLL is a library that contains code and data that can be used by more than one program at the same time. For example, in Windows operating systems, the Comdlg32 DLL performs common dialog box related functions. Therefore, each program can use the functionality that is contained in this DLL to implement an Open dialog box. This helps promote code reuse and efficient memory usage.

By using a DLL, a program can be modularized into separate components. For example, an accounting program may be sold by module. Each module can be loaded into the main program at run time if that module is installed. Because the modules are separate, the load time of the program is faster, and a module is only loaded when that functionality is requested.

Additionally, updates are easier to apply to each module without affecting other parts of the program. For example, you may have a payroll program, and the tax rates change each year. When these changes are isolated to a DLL, you can apply an update without needing to build or install the whole program again.

The following list describes some of the files that are implemented as DLLs in Windows operating systems:
  • ActiveX Controls (.ocx) files
    An example of an ActiveX control is a calendar control that lets you select a date from a calendar.
  • Control Panel (.cpl) files
    An example of a .cpl file is an item that is located in Control Panel. Each item is a specialized DLL.
  • Device driver (.drv) files
    An example of a device driver is a printer driver that controls the printing to a printer.

DLL advantages

The following list describes some of the advantages that are provided when a program uses a DLL:
  • Uses fewer resources
    When multiple programs use the same library of functions, a DLL can reduce the duplication of code that is loaded on the disk and in physical memory. This can greatly influence the performance of not just the program that is running in the foreground, but also other programs that are running on the Windows operating system.
  • Promotes modular architecture
    A DLL helps promote developing modular programs. This helps you develop large programs that require multiple language versions or a program that requires modular architecture. An example of a modular program is an accounting program that has many modules that can be dynamically loaded at run time.
  • Eases deployment and installation
    When a function within a DLL needs an update or a fix, the deployment and installation of the DLL does not require the program to be relinked with the DLL. Additionally, if multiple programs use the same DLL, the multiple programs will all benefit from the update or the fix. This issue may more frequently occur when you use a third-party DLL that is regularly updated or fixed.

DLL dependencies

When a program or a DLL uses a DLL function in another DLL, a dependency is created. Therefore, the program is no longer self-contained, and the program may experience problems if the dependency is broken. For example, the program may not run if one of the following actions occurs:
  • A dependent DLL is upgraded to a new version.
  • A dependent DLL is fixed.
  • A dependent DLL is overwritten with an earlier version.
  • A dependent DLL is removed from the computer.
These actions are generally known as DLL conflicts. If backward compatibility is not enforced, the program may not successfully run.

The following list describes the changes that have been introduced in Microsoft Windows 2000 and in later Windows operating systems to help minimize dependency issues:
  • Windows File Protection
    In Windows File Protection, the operating system prevents system DLLs from being updated or deleted by an unauthorized agent. Therefore, when a program installation tries to remove or update a DLL that is defined as a system DLL, Windows File Protection will look for a valid digital signature.
  • Private DLLs
    Private DLLs let you isolate a program from changes that are made to shared DLLs. Private DLLs use version-specific information or an empty .local file to enforce the version of the DLL that is used by the program. To use private DLLs, locate your DLLs in the program root folder. Then, for new programs, add version-specific information to the DLL. For old programs, use an empty .local file. Each method tells the operating system to use the private DLLs that are located in the program root folder.

DLL troubleshooting tools

Several tools are available to help you troubleshoot DLL problems. The following tools are some of these tools.

Dependency Walker

The Dependency Walker tool can recursively scan for all dependent DLLs that are used by a program. When you open a program in Dependency Walker, Dependency Walker performs the following checks:
  • Dependency Walker checks for missing DLLs.
  • Dependency Walker checks for program files or DLLs that are not valid.
  • Dependency Walker checks that import functions and export functions match.
  • Dependency Walker checks for circular dependency errors.
  • Dependency Walker checks for modules that are not valid because the modules are for a different operating system.
By using Dependency Walker, you can document all the DLLs that a program uses. This may help prevent and correct DLL problems that may occur in the future. Dependency Walker is located in the following directory when you install Microsoft Visual Studio 6.0:
drive\Program Files\Microsoft Visual Studio\Common\Tools

DLL Universal Problem Solver

The DLL Universal Problem Solver (DUPS) tool is used to audit, compare, document, and display DLL information. The following list describes the utilities that make up the DUPS tool:
  • Dlister.exe
    This utility enumerates all the DLLs on the computer and logs the information to a text file or to a database file.
  • Dcomp.exe
    This utility compares the DLLs that are listed in two text files and produces a third text file that contains the differences.
  • Dtxt2DB.exe
    This utility loads the text files that are created by using the Dlister.exe utility and the Dcomp.exe utility into the dllHell database.
  • DlgDtxt2DB.exe
    This utility provides a graphical user interface (GUI) version of the Dtxt2DB.exe utility.
For more information about the DUPS tool, click the following article number to view the article in the Microsoft Knowledge Base:
247957 Using DUPS.exe to resolve DLL compatibility problems

DLL Help database

The DLL Help database helps you locate specific versions of DLLs that are installed by Microsoft software products. For more information about the DLL Help database, visit the following Microsoft Web site:

DLL development

This section describes the issues and the requirements that you should consider when you develop your own DLLs.

Types of DLLs

When you load a DLL in an application, two methods of linking let you call the exported DLL functions. The two methods of linking are load-time dynamic linking and run-time dynamic linking.
Load-time dynamic linking
In load-time dynamic linking, an application makes explicit calls to exported DLL functions like local functions. To use load-time dynamic linking, provide a header (.h) file and an import library (.lib) file when you compile and link the application. When you do this, the linker will provide the system with the information that is required to load the DLL and resolve the exported DLL function locations at load time.
Run-time dynamic linking
In run-time dynamic linking, an application calls either the LoadLibrary function or the LoadLibraryEx function to load the DLL at run time. After the DLL is successfully loaded, you use the GetProcAddress function to obtain the address of the exported DLL function that you want to call. When you use run-time dynamic linking, you do not need an import library file.

The following list describes the application criteria for when to use load-time dynamic linking and when to use run-time dynamic linking:
  • Startup performance
    If the initial startup performance of the application is important, you should use run-time dynamic linking.
  • Ease of use
    In load-time dynamic linking, the exported DLL functions are like local functions. This makes it easy for you to call these functions.
  • Application logic
    In run-time dynamic linking, an application can branch to load different modules as required. This is important when you develop multiple-language versions.

The DLL entry point

When you create a DLL, you can optionally specify an entry point function. The entry point function is called when processes or threads attach themselves to the DLL or detached themselves from the DLL. You can use the entry point function to initialize data structures or to destroy data structures as required by the DLL. Additionally, if the application is multithreaded, you can use thread local storage (TLS) to allocate memory that is private to each thread in the entry point function. The following code is an example of the DLL entry point function.
BOOL APIENTRY DllMain(
HANDLE hModule, // Handle to DLL module
 DWORD ul_reason_for_call, // Reason for calling function
 LPVOID lpReserved ) // Reserved
{
 switch ( ul_reason_for_call )
 {
  case DLL_PROCESS_ATTACHED:
  // A process is loading the DLL.
  break;
  case DLL_THREAD_ATTACHED:
  // A process is creating a new thread.
  break;
  case DLL_THREAD_DETACH:
  // A thread exits normally.
  break;
  case DLL_PROCESS_DETACH:
  // A process unloads the DLL.
  break;
 }
 return TRUE;
}
When the entry point function returns a FALSE value, the application will not start if you are using load-time dynamic linking. If you are using run-time dynamic linking, only the individual DLL will not load.

The entry point function should only perform simple initialization tasks and should not call any other DLL loading or termination functions. For example, in the entry point function, you should not directly or indirectly call the LoadLibraryfunction or the LoadLibraryEx function. Additionally, you should not call the FreeLibrary function when the process is terminating.

Note In multithreaded applications, make sure that access to the DLL global data is synchronized (thread safe) to avoid possible data corruption. To do this, use TLS to provide unique data for each thread.

Exporting DLL functions

To export DLL functions, you can either add a function keyword to the exported DLL functions or create a module definition (.def) file that lists the exported DLL functions.

To use a function keyword, you must declare each function that you want to export with the following keyword:
__declspec(dllexport)
To use exported DLL functions in the application, you must declare each function that you want to import with the following keyword:
__declspec(dllimport)
Typically, you would use one header file that has a define statement and an ifdef statement to separate the export statement and the import statement.

You can also use a module definition file to declare exported DLL functions. When you use a module definition file, you do not have to add the function keyword to the exported DLL functions. In the module definition file, you declare theLIBRARY statement and the EXPORTS statement for the DLL. The following code is an example of a definition file.
// SampleDLL.def
//
LIBRARY "sampleDLL"

EXPORTS
  HelloWorld

Sample DLL and application

In Microsoft Visual C++ 6.0, you can create a DLL by selecting either the Win32 Dynamic-Link Library project type or the MFC AppWizard (dll) project type.

The following code is an example of a DLL that was created in Visual C++ by using the Win32 Dynamic-Link Libraryproject type.
// SampleDLL.cpp
//

#include "stdafx.h"
#define EXPORTING_DLL
#include "sampleDLL.h"

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
      )
{
    return TRUE;
}

void HelloWorld()
{
 MessageBox( NULL, TEXT("Hello World"), TEXT("In a DLL"), MB_OK);
}
// File: SampleDLL.h
//
#ifndef INDLL_H
#define INDLL_H

#ifdef EXPORTING_DLL
extern __declspec(dllexport) void HelloWorld() ;
#else
extern __declspec(dllimport) void HelloWorld() ;
#endif

#endif
The following code is an example of a Win32 Application project that calls the exported DLL function in the SampleDLL DLL.
// SampleApp.cpp 
//

#include "stdafx.h"
#include "sampleDLL.h"

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{  
 HelloWorld();
 return 0;
}
Note In load-time dynamic linking, you must link the SampleDLL.lib import library that is created when you build the SampleDLL project.

In run-time dynamic linking, you use code that is similar to the following code to call the SampleDLL.dll exported DLL function.
...
typedef VOID (*DLLPROC) (LPTSTR);
...
HINSTANCE hinstDLL;
DLLPROC HelloWorld;
BOOL fFreeDLL;

hinstDLL = LoadLibrary("sampleDLL.dll");
if (hinstDLL != NULL)
{
    HelloWorld = (DLLPROC) GetProcAddress(hinstDLL, "HelloWorld");
    if (HelloWorld != NULL)
        (HelloWorld);

    fFreeDLL = FreeLibrary(hinstDLL);
}
...
When you compile and link the SampleDLL application, the Windows operating system searches for the SampleDLL DLL in the following locations in this order:
  1. The application folder
  2. The current folder
  3. The Windows system folder

    Note The GetSystemDirectory function returns the path of the Windows system folder.
  4. The Windows folder

    Note The GetWindowsDirectory function returns the path of the Windows folder.

The .NET Framework assembly

With the introduction of Microsoft .NET and the .NET Framework, most of the problems that are associated with DLLs have been eliminated by using assemblies. An assembly is a logical unit of functionality that runs under the control of the .NET common language runtime (CLR). An assembly physically exists as a .dll file or as an .exe file. However, internally an assembly is very different from a Microsoft Win32 DLL.

An assembly file contains an assembly manifest, type metadata, Microsoft intermediate language (MSIL) code, and other resources. The assembly manifest contains the assembly metadata that provides all the information that is required for an assembly to be self-describing. The following information is included in the assembly manifest:
  • Assembly name
  • Version information
  • Culture information
  • Strong name information
  • The assembly list of files
  • Type reference information
  • Referenced and dependent assembly information
The MSIL code that is contained in the assembly cannot be directly executed. Instead, MSIL code execution is managed through the CLR. By default, when you create an assembly, the assembly is private to the application. To create a shared assembly requires that you assign a strong name to the assembly and then publish the assembly in the global assembly cache.

The following list describes some of the features of assemblies compared to the features of Win32 DLLs:
  • Self-describing
    When you create an assembly, all the information that is required for the CLR to run the assembly is contained in the assembly manifest. The assembly manifest contains a list of the dependent assemblies. Therefore, the CLR can maintain a consistent set of assemblies that are used in the application. In Win32 DLLs, you cannot maintain consistency between a set of DLLs that are used in an application when you use shared DLLs.
  • Versioning
    In an assembly manifest, version information is recorded and enforced by the CLR. Additionally, version policies let you enforce version-specific usage. In Win32 DLLs, versioning cannot be enforced by the operating system. Instead, you must make sure that DLLs are backward compatible.
  • Side-by-side deployment
    Assemblies support side-by-side deployment. One application can use one version of an assembly, and another application can use a different version of an assembly. Starting in Windows 2000, side-by-side deployment is supported by locating DLLs in the application folder. Additionally, Windows File Protection prevents system DLLs from being overwritten or replaced by an unauthorized agent.
  • Self-containment and isolation
    An application that is developed by using an assembly can be self-contained and isolated from other applications that are running on the computer. This feature helps you create zero-impact installations.
  • Execution
    An assembly is run under the security permissions that are supplied in the assembly manifest and that are controlled by the CLR.
  • Language independent
    An assembly can be developed by using any one of the supported .NET languages. For example, you can develop an assembly in Microsoft Visual C#, and then use the assembly in a Microsoft Visual Basic .NET project.