Visual Studio 2010 Compiling with the Debug or Release version of third party library depending on if my project is being compiled Build or Release?

leeand00 picture leeand00 · Mar 30, 2011 · Viewed 13.9k times · Source

I've downloaded a number of 3rd party libraries (dlls) now for Visual Studio 2010/C# and I've noticed that in their distributions \bin directory they usually have two versions Debug and Release.

Is there a way to add these libraries as references to the project, but use the Release build (when I'm building a release), and use the Debug build (when I'm debugging)?

Answer

WaffleSouffle picture WaffleSouffle · Sep 2, 2011
<Reference Include="MyLib">
   <HintPath>..\lib\$(Configuration)\MyLib.dll</HintPath>
</Reference>