2

I know there are quite a few of these "DeployOnBuild=true is being ignored" posts that pop up, and none of the posts I've found have solved my issue.

I'm attempting to build and deploy a WCF service, written in C#, through our build RTC build servers that will deploy to a file share. I don't believe that RTC is the culprit here, but it fees like important information to mention regardless. The publishing profile that is set for use is one that successfully publishes when run through Visual Studio 2015. The switch /p:DeployOnBuild=true is being completely ignored when the msbuild command fires off. The msbuild command has been issued both directly from the command line as part of a larger powershell script. Here are some of the various msbuild commands I have issued without success.

msbuild PathToSolutionFile\SolutionFile.sln /p:DeployOnBuild=true /p:VisualStudioVersion=14.0 /p:Configuration=Debug /p:Platform="Any CPU" /p:PublishProfile=DevelopmentDeploy

msbuild PathToSolutionFile\SolutionFile.sln /p:DeployOnBuild=true /p:VisualStudioVersion=14.0 /p:Configuration=Debug /p:Platform="Any CPU" /p:PublishProfile=ActualPublishProfile.pubxml

msbuild PathToProjectFile\ProjectFile.csproj /p:DeployOnBuild=true /p:VisualStudioVersion=14.0 /p:Configuration=Debug /p:Platform="Any CPU" /p:PublishProfile=DevelopmentDeploy

The build is successful for each of these, and the log file produced shows no signs of even having the publishing profile attempted to be used, let alone skipped. This holds true even when I include the switch /v:diag for more detailed output in the produced log.

I resorted to trying a powershell script, although not necessary for what I'm trying to accomplish. Here's the script I put together quickly as a test just so I could use variables to accommodate any potential issues with my switches.

$serverPath = 'C:\ServerPath'
$solutionPath = $serverPath + '\ProjectFolder\SolutionFile.sln'
$projectPath = $serverPath + '\ProjectFolder\ProjectFile.csproj'
$configuration = 'Debug'
$platform = "Any CPU"

$publishProfile = 'DevelopmentDeploy'
$buildProperties = "/p:DeployOnBuild=true /p:VisualStudioVersion=14.0 /p:Configuration=$configuration /p:Platform=$platform /p:PublishProfile=$publishProfile"

Write-Host ""
Write-Host "-- msbuild STARTING --"
Write-Host ""

$msbuild = 'C:\Program Files (x86)\MSBuild\14.0\Bin\amd64\MSBuild.exe'

# Run MSBuild
& $msbuild ($solutionPath, $buildProperties)

Write-Host ""
Write-Host "-- msbuild COMPLETE --"
Write-Host ""

Again, this quick powershell throw-together was also run with /v:diag without any reported issues about why DeployOnBuild=true was skipped.

Any help or insight would be greatly appreciated.

Thanks!

0 Answers0