Visual Studio command-line build pauses with warning message box

拜拜、爱过 提交于 2020-01-17 05:51:19

问题


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 new site 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!