Using Msbuild to Execute a File System Publish Profile

Using msbuild to execute a File System Publish Profile

FYI: I had the same issue with Visual Studio 2015. After many of hours trying, I can now do msbuild myproject.csproj /p:DeployOnBuild=true /p:PublishProfile=myprofile.

I had to edit my .csproj file to get it working. It contained a line like this:

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" 
Condition="false" />

I changed this line as follows:

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" />

(I changed 10.0 to 14.0, not sure whether this was necessary. But I definitely had to remove the condition part.)

MSBuild with publish profiles and configuration merges

I installed VS update 3 on the build server an it's working now.

MsBuild publish website without using publish profile

You can actually override the PublishProfile settings from the command line. You would want this parameter:

/p:publishUrl=pathToPublishHere

If it's local filesystem this should work just fine.



Related Topics



Leave a reply



Submit