.NET Different References List for Debug / Release

vb.net, visual-studio, visual-studio-2008

Solution

Yes this is possible but it will require you to manually edit the .vbproj file. Once you have the file open you'll an XML reference tag for the DLL's you've referenced and it will look like the following

<Reference Include="SomeDllName" />

You need to add a condition property which species it should only be done during debug time

<Reference Include="SomeDllName" Condition="'$(Configuration)'=='Debug'" />

Problem

In my debug build I have a reference to a DLL that is only required in the Debug configuration (the reference is for CodeSite, a logging tool). Is it possible to exclude this reference in the Release build (my logging class only uses this reference when built in the Debug configuration). Using VB.NET and VS2008.

Original source