24
votes

I am trying to do a web deploy publish using MS Build for two web applications for internal use and testing. I have set up different solution configurations for each of the environments that i want to publish to. IE DevA, DevB. I have updated all the web.configs to do the correct transformations. As a note, the transforms work when i do a right click publish through Visual Studio so I have ruled those out as the problem. My current bat file that I am running uses this command to do the work:

"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild" project.csproj /t:Clean;Rebuild;Publish /p:DeployOnBuild=true;PublishProfile=DevB1_API;AllowUntrustedCertificate=True;username=username;password=password

When i run this command the publish works just fine. However, the web.config is not being transformed. Am i missing a msbuild parameter to force this to happen? Any Help would be appreciated! thanks.

1

1 Answers

30
votes

Apparently, for the transform to be executed, you have to specify a build configuration using:

/p:Configuration=Release