How can I override a pubxml setting via command line in automated deployment scenario?

850 Views Asked by At

When publishing a web application with msbuild command line utility, I specify a publish profile name like "dev", which corresponds to the "dev.pubxml" file in the project's Properties/PublishProfiles directory. The file contains setting for publishing to our development environment.

By default, the XML node at Project/PropertyGroup/LaunchSiteAfterPublish contains a value of "True". Is there a way I can set it to false via the command line, or will I have to write a script in my build engine to edit the XML file before calling msbuild?


Why I want to do this: If I'm publishing from Visual Studio, I want it to open the web page for testing. If the build is automated and running from the command line, then I don't want the build automation system to open the web page.

1

There are 1 best solutions below

0
vijayrkn On

From the commandline you can pass the publish profile & any properties that you wish to override. e.g in this case: msbuild <proj>.csproj /p:PublishProfile=dev /p:LaunchSiteAfterPublish=false