How to: Locate Assemblies by Using DEVPATH

Switch View :
ScriptFree
.NET Framework 4
How to: Locate Assemblies by Using DEVPATH

Developers might want to make sure that a shared assembly they are building works correctly with multiple applications. Instead of continually putting the assembly in the global assembly cache during the development cycle, the developer can create a DEVPATH environment variable that points to the build output directory for the assembly.

For example, assume that you are building a shared assembly called MySharedAssembly and the output directory is C:\MySharedAssembly\Debug. You can put C:\MySharedAssembly\Debug in the DEVPATH variable. You must then specify the <developmentMode> element in the machine configuration file. This element tells the common language runtime to use DEVPATH to locate assemblies.

The shared assembly must be discoverable by the runtime. To specify a private directory for resolving assembly references use the <codeBase> Element or <probing> Element in a configuration file, as described in Specifying an Assembly's Location. You can also put the assembly in a subdirectory of the application directory. For more information, see How the Runtime Locates Assemblies.

NoteNote

This is an advanced feature, intended only for development.

The following example shows how to cause the runtime to search for assemblies in directories specified by the DEVPATH environment variable.

Example

<configuration>
  <runtime>
    <developmentMode developerInstallation="true"/>
  </runtime>
</configuration>

This setting defaults to false.

Note Note

Use this setting only at development time. The runtime does not check the versions on strong-named assemblies found in the DEVPATH. It simply uses the first assembly it finds.

See Also

Other Resources

Community Content

Dan.G
developmentMode setting must be configured in the machine.config
Setting developmentMode in App.config didn't seem to work, so having it set in machine.config, as the article suggests, was the only way I could get it going...

Vadim Meleshuk
Machine config vs app config
The article suggests modifying machine.config. App.config works too, and in many situations is preferable to machine.config, as with the machine.config modified, all of the managed apps will fail to start if DEVPATH is not also set. For example, if using macnine.config with services running in the system context, you'll need to supply DEVPATH globally.

Vadim Meleshuk
Variable format
The value format is a semicolon-separated string, just like PATH.

BOBAH123
What's the variable format?
Is it a single path, multiple paths? If multiple paths, are they separated by semicolon? The doc couldn't be more vague than now.