Monthly Archives: September 2017

MSBuild command line ignoring publish properties: solution

MSBuild 2017 command line seems to ignore your publish profile? You are trying to run a command similar to this and your projects/artifacts are not copied where they are supposed t be copied?

msbuild /p:Configuration=Release /p:DeployProjects=true /p:PublishProfile=Release

I have msbuild in my PATH, which is here just in case:
C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\15.0\\Bin\\amd64\\msbuild.exe

Maybe you are using a build server, with Jenkins or a similar tool and you did not install Visual Studio 2017. I have such a setup and I installed just the ms build tools standalone package, find it at the bottom of this page: Build Visual Studio Downloads > find Build Tools for Visual Studio 2017.

This seems to be a well known issue, on github somebody reported the problem, and many people joined with a comment "Same to me".


In my case, I noticed I forgot to select also Web development build tools > .NET Framework 4.6.2 development tools:

Updating ms build tools and adding this missing component did the job. Now when I run msbuild I get my artifacts as expected.

If this solution helped you, consider buying something at my favorite affiliate website. I consider this better than asking a donation, because like this you get a product you may need and use and I just get a little commission, which doesn't affect the price, so win to win ;)