Using MSBuild.exe to “Publish” a ASP.NET MVC 4 project with the cmd line

前端 未结 5 1044
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-07 08:23

I\'m looking for a command to run against the MSBuild.exe that just takes a MVC 4 project and publishes it to a given directory.

For example,



        
5条回答
  •  清歌不尽
    2020-12-07 09:09

    I found sayed answer was deploying the default configuration i.e. Debug. The configuration selected in the Publishing Profile seems to get ignored by MSBuild. Accordingly I changed the command to specify the correct configuration for the deployment...

    msbuild mysln.sln /p:Configuration=[config-name] /p:DeployOnBuild=true /p:PublishProfile=[profile-name]
    

    where config-name = Release or some other build configuration you've created

提交回复
热议问题