visual studio - Making .NET References Configuration dependant -


i have several configurations app make debug/release builds , 32 bit , 64 bit builds. 32 , 64 bit builds need reference different dlls (namely build x86 , build x64) references seem global project , don't depend on configuration. have exchange references when switch 32 bit 64 bit build (and vice versa). appropriate way achieve different references different configurations?

this can done little bit of manual manipulation of project files.

first need right click on project, , click unload project. right click on again , select edit [project name].

when loaded in editor see various entries refences:

<itemgroup>     <reference include="system.xml" />     <reference include="windowsbase">         <requiredtargetframework>3.0</requiredtargetframework>     </reference>     <reference include="presentationcore">         <requiredtargetframework>3.0</requiredtargetframework>     </reference>     <reference include="presentationframework">         <requiredtargetframework>3.0</requiredtargetframework>     </reference>     <reference include="microsoft.practices.servicelocation, version=1.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35, processorarchitecture=msil">         <specificversion>false</specificversion>         <hintpath>..\common\lib\3rdparty\prism\4.0\desktop\microsoft.practices.servicelocation.dll</hintpath>     </reference> </itemgroup> 

note these inside itemgroup node. can perform little magic... add expression itemgroup used if build configuration bitness:

<itemgroup condition="'$(configuration)|$(platform)' == 'release|x86'">     <!-- these references used when there release x86 build -->     <reference include="system.xml" /> </itemgroup> 

note there no way through ui, have manually manage these reference lists (e.g. if need add reference).

also note not hack... utilising 1 of features of msbuild (which used vs build projects). can have many of these itemgroup lists using expression - if doesn't have expression included in build.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -