Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using different DLL's for debug and release builds [duplicate]

Does anybody know if it is possible, and if so how to link to one set of DLL's in a debug build and a different set of DLL's in a release build on a C# Project using Visual Studio 2008?

like image 398
DukeOfMarmalade Avatar asked Feb 10 '12 12:02

DukeOfMarmalade


2 Answers

If you Unload the project file (context menu of the project) and then edit it, add a condition on the itemgroup for each build configuration holding the references:

<ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <Reference Include="Common.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL" />
    <Reference Include="Elmah, Version=1.2.13605.0, Culture=neutral, processorArchitecture=MSIL" />
</ItemGroup>

After saving your changes, you can Reload the project from the context menu of the project file.

like image 189
rene Avatar answered Oct 13 '22 08:10

rene


I don't think this can be done with default means of Visual Studio. One thing I could think of is to create some sort of "debug flag" and load the DLLs dynamically depending on that flag.

like image 33
Thorsten Dittmar Avatar answered Oct 13 '22 08:10

Thorsten Dittmar