Consider the following scenario:
- Alice creates Web application (ASP.NET MVC or WebForms) using Visual Studio 2012.
- Alice creates a Publish Profile called "PRODUCTION" and chooses "Release" configuration in the Settings tab (in the Publish Wizard).
- Alice publishes the application using the Publish Profile called "PRODUCTION".
- Alice saves the solution into source control.
Note that by default the "*.pubxml.user
" file is not included in source control: http://msdn.microsoft.com/en-us/library/ff398069.aspx
- Bob does a Checkout of the solution from the source control.
- Bob opens the solution and launches the Publish Wizard.
- Bob sees the selected Publish Profile is called "PRODUCTION".
- Bob clicks on Settings tab (in the Publish Wizard) and sees the displayed configuration is "Release".
- Bob publishes the application.
- Bob realizes the application was published using "Debug" configuration instead of "Release" configuration.
The reason is the information about the build configuration is stored in the file "*.pubxml.user
" (See node called <LastUsedBuildConfiguration>
).
This behavior is problematic especially when you use Web config transformations ("Web.Release.config") to change connection strings.
=> How can I fix this problem if I don't want to save "*.pubxml.user
" file into source control (because this file can contains other information inappropriate for a public repository for example)?
Related articles: