Visual Studio命令行生成暂停并显示警告消息框 [英] Visual Studio command-line build pauses with warning message box
问题描述
我们的自动构建过程如下:
-
构建脚本将存储库的最新版本提取到一个干净的目录中
-
它使用以下命令行命令运行构建
devenv SolutionFile.sln/rebuild"ServerDeployment |任何CPU" |外文件-FilePath $ BuildOutputFile
我希望它可以无人值守.
但是随后构建暂停以显示模式对话框:
将IIS Express设置应用于服务器URL' http://localhost:60143/'时发生错误用于项目"CMS.Website".您可能必须手动编辑applicationHost.config文件并进行更改,以使站点正常运行.
我必须按OK才能继续构建.这不再是无人值守的工作版本.
我看到Visual Studio在我的生成文件夹中自动生成了一个文件.vs\applicationhost.config
.
我将此文件与开发文件夹中的文件.vs\applicationhost.config
进行了比较.我可以在开发文件夹中看到该文件的版本(不会引起错误),该文件在以下节点下具有一个额外的site
条目://configuration/system.applicationHost/sites
如何使此消息框消失?显然,我不在乎是否在IIS Express上运行,因为我正在执行要在另一台服务器上部署的构建.
可能的解决方案(我不太喜欢)是:
- 将文件.vs \ applicationhost.config检入存储库中,以便将其检出作为构建的一部分,而不是重新生成
- 修改我的构建脚本,以便它从
C:\Program Files\IIS Express\config\templates\PersonalWebServer\applicationhost.config
复制模板文件,然后修改此XML文件以手动添加新的site
条目
我的问题有更好的解决方案吗?
就我而言,调试设置存储为Web应用程序.csproj
文件(已检入存储库的一部分)的一部分.>
应将其存储为.csproj.user
文件的一部分(该文件不会检入).
在我的项目设置中,我需要确保未选中将服务器设置应用于所有用户(存储在项目文件中)".
一旦我取消选中此设置,自动化构建就会从头到尾运行,而不会显示模式消息框.
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?
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.
这篇关于Visual Studio命令行生成暂停并显示警告消息框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!