How to reference different version of dll with MSBuild

前端 未结 2 1799
梦毁少年i
梦毁少年i 2020-12-02 22:42

I have a web application project which utilises a set of 3rd party dll\'s. The issue is that the dev/staging environment is 32bit, but production is 64bit. As such, we have

2条回答
  •  情深已故
    2020-12-02 23:45

    You can create conditional references in the project file like this:

    
    
    

    To use this inside VS, you have to create two solution platforms: one for the x86 target and one for the x64 target. Depending on the active platform one of the dlls will be selected, no need for re-referencing.

    To automate this using msbuild, create a new project file that builds the other project file a number of times, each time for a different platform/configuration/...:

    
      
      
      
    
    

    Have a look at the MSBuild task reference for aditional options like building in parallel.

提交回复
热议问题