Monday, September 22, 2008

Referencing DLLs in Visual Studio 2008


Following problem:

In my project I have to reference the Microsoft.VisualStudio.Profiler.dll, which on my computer is at:

C:Program FilesMicrosoft Visual Studio 9.0Team ToolsPerformance Tools

As some of your developer machines use a German setup, on these machines this DLL is at:

C:ProgrammeMicrosoft Visual Studio 9.0Team ToolsPerformance Tools

So how can I tell Visual Studio to search for the DLL in different directories depending on the machine it is installed?

The solution is easy.

Just add the directory to the "Reference Path" in the projects properties.



The "Reference Path" is stored in "fooproject.csproj.user" so every user can set it differently without interfering with each other.

The downside of this is that every user has to set the "Reference Path".

It would be a better solution to be able to use the %ProgramFiles% system variable in the "Reference Path" and share this setting among all users.


Post a Comment