简体   繁体   中英

msbuild with mvc and web api project in a single solution

I have a solution include 2 project with 2 publish profile:

WebApplication Project: App.pubxml

WebApi Project: Api.pubxml

When I using the Team Foundation Server Build Definition, i set the MSBuild Arguments to

/p:DeployOnBuild=true /p:PublishProfile=App /p:PackageLocation=$(build.artifactstagingdirectory)\Build

It will build error and alert me that it can't found app.pubxml in WebApi Project.

So, My question are:

  1. Why msbuild will build these 2 project not only one of them?

  2. Can I separate using different publish profile in the msbuild arguments Or Can I only build only one of the project?

Publish profiles generally describe the target environment rather than the source project, for example Development, Staging and Production.

If you think about it in those terms it makes sense for each publish profile to have the same name, so if you rename your profiles to have the same name you shouldn't get an error.

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