共用方式為


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.

NoteNote

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

Configuring Applications