Using msbuild to execute a File System Publish Profile

后端 未结 7 1816
萌比男神i
萌比男神i 2020-11-28 06:09

I have a c# .Net 4.0 project created with VS2010 and now being accessed with VS2012.

I\'m trying to publish only the needed files from this website to a destination

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 06:32

    FYI: Same problem with running on a build server (Jenkins with msbuild 15 installed, driven from VS 2017 on a .NET Core 2.1 web project).

    In my case it was the use of the "publish" target with msbuild that ignored the profile.

    So my msbuild command started with:

    msbuild /t:restore;build;publish
    

    This correctly triggerred the publish process, but no combination or variation of "/p:PublishProfile=FolderProfile" ever worked to select the profile I wanted to use ("FolderProfile").

    When I stopped using the publish target:

    msbuild /t:restore;build /p:DeployOnBuild=true /p:PublishProfile=FolderProfile
    

    I (foolishly) thought that it would make no difference, but as soon as I used the DeployOnBuild switch it correctly picked up the profile.

提交回复
热议问题