简体   繁体   中英

MSBuild building project references

I am trying to use msbuild to build my project and deploy it as a clickonce. When I build my project inside visual studio, everything is fine and when I build my solution in msbuild everything works fine. The problem is when I try to build a specific project using msbuild.

I set my platform for the project I want to compile to X64 ex: /p:Platform=X64 but some of the referenced projects require Any CPU in order to compile properly. When I try to change their platform in configuration manager to X64 I get a bunch of build errors.

How do I let msbuild know to build certain projects using Any CPU and others using X64?

Here's what I have right now

msbuild /t:publish /p:Configuration=Release /p:DeployOnBuild=true /p:Platform=X64 /p:PublishDir=\\dir\to\publish\to C:\dir\to\project\project.csproj

In Visual Studio, you should be able to select "Mixed Platforms" as the active solution platform in the Configuration Manager window (with the solution open in Visual Studio, go to Build > Configuration Manager... to open the window).

You should be able to select "Mixed Platforms" as the active platform (you can do this for Debug and Release configurations (and/or other custom configuration names you may have specified). With "Mixed Platforms" selected, you should be able to specify which platform each project should target, as well as specify whether or not the projects should be build in that specific configuration-platform combination at all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM