Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set a path in Visual Studio?

How do I set a path for DLL files to be searched in Visual Studio for a particular project alone?

Now I am setting it in the environment path variable, but I would like better control over this.

like image 412
yesraaj Avatar asked Jan 09 '09 13:01

yesraaj


People also ask

How do I add a path in Visual Studio?

In the System dialog box, click Advanced system settings. On the Advanced tab of the System Properties dialog box, click Environment Variables. In the System Variables box of the Environment Variables dialog box, scroll to Path and select it.

How do I change the path in Visual Studio?

In Visual Studio, click Tools > Options. Expand Projects and Solutions and click Locations. The Projects location field defines the default location for storing new projects. You can change this path if you are using a different working folder.

How do I find the path in Visual Studio?

Ctrl+Click or Double Right Click to Open Containing Folder, Right click to Copy Full Path. This lightweight extension lets you display the full path of the file at bottom of Visual Studio's Editor.


2 Answers

Search MSDN for "How to: Set Environment Variables for Projects". (It's Project>Properties>Configuration Properties>Debugging "Environment" and "Merge Environment" properties for those who are in a rush.)

The syntax is NAME=VALUE and macros can be used (for example, $(OutDir)).

For example, to prepend C:\Windows\Temp to the PATH:

PATH=C:\WINDOWS\Temp;%PATH% 

Similarly, to append $(TargetDir)\DLLS to the PATH:

PATH=%PATH%;$(TargetDir)\DLLS 
like image 68
Multicollinearity Avatar answered Oct 25 '22 23:10

Multicollinearity


You have a couple of options:

  • You can add the path to the DLLs to the Executable files settings under Tools > Options > Projects and Solutions > VC++ Directories (but only for building, for executing or debugging here)
  • You can add them in your global PATH environment variable
  • You can start Visual Studio using a batch file as I described here and manipulate the path in that one
  • You can copy the DLLs into the executable file's directory :-)
like image 39
Timo Geusch Avatar answered Oct 25 '22 23:10

Timo Geusch