开发者

Configuration for ProjectReference in MSBuild

开发者 https://www.devze.com 2023-03-19 01:23 出处:网络
Is it possible to set the configuration of ProjectReference in MSBuild? Scenario: I have a build script (web deploy) that has a number of configurations where the only difference has to do with how t

Is it possible to set the configuration of ProjectReference in MSBuild?

Scenario: I have a build script (web deploy) that has a number of configurations where the only difference has to do with how they are deployed and not the build it self. I would hate to have to maintain configurations for my solution/projects that are 开发者_C百科build as a part of the deploy process just because I need those configurations for deployment. Any way I can accomplish this?


Another possible method of setting ProjectReference configuration and platform is to use a property picked up the MSBuild's reference handling code called SetPlatform and SetConfiguration. Example:

<ProjectReference Include="path to project.projext">
  <SetPlatform>Platform=x64</SetPlatform>
  <SetConfiguration>Configuration=Release</SetConfiguration>
</ProjectReference>


Leaving the question in case some one else gets the same idea as I did. The solution was pretty straight forward. Don't do it. Turn it around. Just use any other property for the deployment script and map the different deployment configuration to existing Project configurations.

0

精彩评论

暂无评论...
验证码 换一张
取 消