Visual Studio command line is pausing with warning message

Our automatic build process is as follows:

  • The script string retrieves the latest version of the repository into a clean directory.

  • It starts the build using the following command line command

devenv SolutionFile.sln / rebuild "ServerDeployment | Any processor" | out-file -FilePath $ BuildOutputFile

I want this to run unattendend.

But then the assembly pauses the display of the modal dialog:

An error occurred while applying IIS Express settings to the server URL http: // localhost: 60143 / 'for the project' CMS.Website '. You may need to manually edit the applicationHost.config file and make the necessary changes for your site.

I need to click OK to continue the build. This no longer works unattended.

I see that Visual Studio automatically created the .vs\applicationhost.config file in my build folder.

I compared this file with the .vs\applicationhost.config file in my development folder. I see that the version of the file in my development folder (which does not cause errors) contains an additional site entry in the node section: //configuration/system.applicationHost/sites

enter image description here

How can I remove this message box? Obviously, I don't care if this works on IIS Express or not, because I'm doing a build that will be deployed to another server.

Possible solutions (which I especially don't like):

  • Check the .vs \ applicationhost.config file in the repository, so it is checked as part of the assembly, and not regenerated.
  • Modify my build script to copy the template file from C:\Program Files\IIS Express\config\templates\PersonalWebServer\applicationhost.config and then modify this XML file to manually add a new site entry

Is there a better solution to my problem?

0
visual-studio visual-studio-2017 iis-express
source share
1 answer

In my case, the debug settings were saved as part of the .csproj web application .csproj (which is part of the registered repository).

It should be saved as part of the .csproj.user file (which does not receive validation).

In my project settings, I needed to make sure that "Apply server settings to all users (save in the project file)" was not checked.

enter image description here

As soon as I turned off this option, automatic assembly was performed from start to finish without providing a modal message box.

+1
source share

All Articles