How to automate Visual Studio 2017 web project publish to folder How to automate Visual Studio 2017 web project publish to folder powershell powershell

How to automate Visual Studio 2017 web project publish to folder


this did not put any files in the bin\Release\PublishOutput location. It looked like it just did a standard build

I have reproduced this issue with your command line. After research this issue for a long time, I try to remove the parameter "/p:VisualStudioVersion=15.2", then re-publish the project with the command line:

msbuild MyProject.csproj /p:DeployOnBuild=true /p:PublishProfile="MyProfile.pubxml"

It build and publish successfully, and web project publish to folder where you set in the option "<publishUrl>" in MyProfile.pubxml.

So please try to remove the parameter "/p:VisualStudioVersion" in the MSBuild command line, check if it works for you.

Note: I have also test that command line with VisualStudioVersion for the project created by the Visual Studio 2015, it works fine. Not sure whether this is a issue for Visual Studio 2017, I need to confirm it, if it`s a issue for Visual Studio 2017, I will send this issue to Visual Studio team.