MSBuild Script and VS2010 publish apply Web.config Transform

前端 未结 6 1301
囚心锁ツ
囚心锁ツ 2020-11-28 01:13

So, I have VS 2010 installed and am in the process of modifying my MSBuild script for our TeamCity build integration. Everything is working great with one exception.

6条回答
  •  不知归路
    2020-11-28 01:45

    Another answer to this topic after I've been searching for days before I tackled this issue:

    Your publish profile and configuration names should match.

    In my case mine didn't. Manually publishing through the publishing profile gave me the result I wanted, because my configuration was set in the publish profile. MSBuild however tries to be intelligent and magically connects the publish profile and configuration based on name. (Adding the /p:Configuration in the command resulted in other strange errors about the outputpath of a referenced project).

    Just to be exactly clear in what I mean:

    MSBuild statement from command line

    msbuild myproject.csproj -t:Clean -t:Rebuild /p:DeployOnBuild=true /p:PublishProfile="Development"

    WORKS

    • Publish Profile name: Development
    • Solution Configuration name: Development

    DOES NOT WORK

    • Publish Profile name: Development
    • Solution Configuration name: Dev

    Hope this helps!

提交回复
热议问题