Data Browser - Viewing Site  Sector 23 Code Bank Logged in as:  Guest  




           


Msbuild fails if PublishDir contains spaces
Using msbuild for a clickonce deployment, (or other), if PublishDir (or OutDir) contains spaces and/or hyphens or other special characters, the build will fail with an error.

Normally, PublishDir/OutDir must end with a backslash.
However, if the path contains spaces/punctuation, it must end in TWO backslashes.

This will solve the problem.

Powershell example for ClickOnce:
$msbuild_output = "$rootPath\Publish\$Env\\" #MUST end in \\ in case directory contains spaces/hyphens
&"$($msBuildExe)" "$($slnPath)" /t:"clean,rebuild,publish" /p:ProductName="$($prodName)" /p:PublishDir="$($msbuild_output)" /p:Configuration="$($configuration)" /p:InstallUrl="$($deployPath)/" /p:IsWebBootstrapper=true /p:InstallFrom=Web

Created By: amos 6/5/2019 2:03:22 PM