Jason
Jason

Reputation: 1226

MSBuild Post Event works in Visual Studio 2012 but not 2013

I have the following post build event which works in VS 2012, but throws and error in VS 2013.

if $(ConfigurationName) == Debug (
echo "Building In Debug No Minification".
) ELSE (
$(MSBuildBinPath)\msbuild.exe "$(ProjectDir)MSBuild\MSBuildSettings.xml"
)

Here is the error I receive in VS 2013:

Error   109 The command "if Debug == Debug (
echo "Building In Debug No Minification".
) ELSE (
C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe "C:\Development\dir1\dir2\MSBuild\MSBuildSettings.xml"
)" exited with code 255.

The post build event is doing minification and obfuscation with YUI Compressor.

Upvotes: 0

Views: 392

Answers (1)

Hans Passant
Hans Passant

Reputation: 941257

The MSBuild path has changed in VS2013. It now has spaces. Which requires you to use double-quotes around the path name, even if the command doesn't actually get used. Fix:

  "$(MSBuildBinPath)\msbuild.exe" "$(ProjectDir)MSBuild\MSBuildSettings.xml"

Upvotes: 3

Related Questions