问题
Our automated build process is as follows:
The build script fetches the latest version of the repository into a clean directory
It runs the build using the following command line command
devenv SolutionFile.sln /rebuild "ServerDeployment|Any CPU" | out-file -FilePath $BuildOutputFile
I want this to run unattendend.
But then the build pauses to display a modal dialog:
An error occurred when applying the IIS Express settings to server URL 'http://localhost:60143/' for project 'CMS.Website'. You may have to manually edit the applicationHost.config file and make the changes for your site to run correctly.
I have to press OK for the build to continue. This is no longer a working unattended build.
I see that Visual Studio has automatically generated a file .vs\applicationhost.config
in my build folder.
I compared this file with the file .vs\applicationhost.config
in my development folder. I can see the version of the file in my development folder (which doesn't cause errors) has an extra site
entry under the node: //configuration/system.applicationHost/sites
How can I make this message box go away? Obviously I don't care if this runs on IIS Express or not, because I'm performing a build to be deployed on a different server.
Possible solutions (that I don't particularly like) are:
- Check the file .vs\applicationhost.config into the repository, so it gets checked out as part of the build rather than regenerated
- Modify my build script so it copies the template file from
C:\Program Files\IIS Express\config\templates\PersonalWebServer\applicationhost.config
and then modifies this XML file to manually add the newsite
entry
Is there a better solution to my problem?
回答1:
In my case, the debug settings were stored as part of the Web Application's .csproj
file (which is part of the checked-in repository).
It should be stored as part of the .csproj.user
file (which does not get checked in).
In my project settings I needed to make sure that 'Apply server settings to all users (store in project file)' was unchecked.
Once I unchecked this setting the automated build ran from start to finish without presenting a modal message box.
来源:https://stackoverflow.com/questions/43748878/visual-studio-command-line-build-pauses-with-warning-message-box