c# - Can I set different References for different configurations of a .NET build in VS 2010? -


i have solution has built against different versions of dependency dlls. i'd configure solution have different configurations (targets) different 'versions' of target platform. (we're building libraries 3rd party framework , have target multiple versions)

i thought relatively simple set references solution different each of target versions, have not been able successfully. suspect doing wrong.

attached screen shot.

as can see have made number of 'target' configurations , want target configurations able control version of dependencies resulting dll built against.

we not have control on dlls , can not rebuild version call-forwarding differently. enter image description here

i have not tried this, try editing csproj file in text/xml editor, , adding condition references itemgroups, e.g.,

  <itemgroup condition="'$(configuration)|$(platform)' == 'release|anycpu'">     <reference include="system">       <name>system</name>     </reference> 

you need create itemgroup each configuration need different references.

alternatively, may able use dependency injection load appropriate assembly @ run-time. easier if referenced assemblies implement same interface, calling code coded against interface , not underlying implementation in different assemblies.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -