Using msbuild to execute a File System Publish Profile

后端 未结 7 1759
萌比男神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条回答
  • 2020-11-28 06:45

    Still had trouble after trying all of the answers above (I use Visual Studio 2013). Nothing was copied to the publish folder.

    The catch was that if I run MSBuild with an individual project instead of a solution, I have to put an additional parameter that specifies Visual Studio version:

    /p:VisualStudioVersion=12.0
    

    12.0 is for VS2013, replace with the version you use. Once I added this parameter, it just worked.

    The complete command line looks like this:

    MSBuild C:\PathToMyProject\MyProject.csproj /p:DeployOnBuild=true /p:PublishProfile=MyPublishProfile /p:VisualStudioVersion=12.0
    

    I've found it here:

    http://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/command-line-deployment

    They state:

    If you specify an individual project instead of a solution, you have to add a parameter that specifies the Visual Studio version.

    0 讨论(0)
提交回复
热议问题