We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback
Platform : WinForms
|
Category : Tips

How does VS.Net find the referenced assemblies when I build a project from the command line?

There are a couple of ways to specify where VS.Net looks for the assemblies that you reference in your project when building from the command line.

One way is to specify the "HintPath" for the reference:

<Reference
	Name = "MyAssembly.dll"
	AssemblyName = "MyAssembly.dll"
	HintPath = "..\work\samples\assemblies\MyAssembly.dll"
/>

However, this would require all of the systems that build the application to have the exact same directory structure locally. There are often times when this is not wanted (or needed), such as having a script on a build machine.

In this type of situation, you can use the DEVPATH environment variable, or make use of the Public Assembly folder functionality

To use the DEVPATH environment variable, you would simply add the folder that contains the assembly (e.g. "c:\work\samples\assemblies") to the list of directories. Then, you will need to specify the <developmentMode> element in the machine configuration file:

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

This will instruct the CLR to locate the assemblies based on the DEVPATH environment variable.

A less restrictive way to specify the assembly locations is by making use of the Public Assembly Folder functionality. This is done by adding a path to the PublicAssemblies registry key.

Open up the registry, and locate the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\AssemblyFolders" key (for VS.Net 2003, you would look under the "...\VisualStudio\7.1\AssembliesFolders" key). You will see a subkey named "PublicAssemblies". This is where you will want to add additional keys to create your own Public folders. To add your own folder, create a key (e.g. MyAssemblies), and set the default value to be the desired path (e.g. "c:\work\samples\assemblies").

The option you choose will simply depend on your needs.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon