After upgrading to Visual Studio 15.7 Preview 2 (added ANCM InProcess support for IIS Express), the aspNetCore section of a custom Web.config added to the project gets overwritten when starting IIS Express in Debug mode via Visual Studio UI. If hostingModel="InProcess" exists, this attribute gets removed so the application won't run in-process. Also, startupTimeLimit="3600" and requestTimeout="23:00:00" are added. Finally, environment variables ASPNETCORE_HTTPS_PORT and ASPNETCORE_ENVIRONMENT are added as well. Of course, deploying such a messed up Web.config file to the production server doesn't work out well.
@shirhatti / @jkotalik / @muratg - where should this issue get routed to?
@BillHiebert
Yeah, looks like a tooling bug.
@rockerinthelocker so you're not observing the overwrite in Release mode?
@muratg , Just checked and happens in release mode as well. Only publish is not affected.
Thanks @rockerinthelocker, yeah that's a little less surprising :)
@BillHiebert where is the best place to track this issue?
Upgraded to Visual Studio 15.6.4 yesterday and can confirm it is also happening on that version.
@postie77 - are you running against IIS or IIS Express? if IIS this is the expected behavior, though we are investigating trying to improve this. For IIS Express, if you remove the ANCM information from web.config, VS will write it into the applicationhost.config file that resides in the
@BillHiebert We're also seeing this on our side. We are often deploying (using publish - right click on the web project) on our local IIS. This then "transforms" our web.config with theses unwanted values. The devs usually forgets them and they get checked-in, then it moves "silently" into the other environments. Really annoying. Using VS 15.6.5.
I think this is related and it seems to be fixed in the latest release of VS
https://developercommunity.visualstudio.com/content/problem/220371/webconfig-modified-startuptimelimit3600-requesttim.html
Closing because it appears this issue is fixed. If anyone is still running into this, please let us know. Thanks!
@Elion, after upgrading to Visual Studio 15.9.0 the issue returned. After IIS Express start web.config gets overwritten with added <environmentVariable name="ASPNETCORE_HTTPS_PORT" value="44350" /> line. If this matters, I have next configuration in launchSettings.json:
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "https://localhost:44350/",
"sslPort": 44350
}
}
Similar issue which has been happening for a bit of time now, so not sure exactly which version this started happening in.
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="#{ASPNETCORE_ENVIRONMENT}"/>
Is being overwritten with:
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
@ChristopherL-STCU, during investigation of other issue I stumbled on this comment, according to it, web.config will be rewritten any time, when it is present and it is different from what ANCM module is generating during startup. So, the possible solutions to keep web.config untouched by ANCM for now are:
@d-dizhevsky thanks for the info and tips. And yes, it's an Octopus substitution variable.
@ChristopherL-STCU, you mentioned other person, but anyway, you are welcome :smile:.
Most helpful comment
@Elion, after upgrading to Visual Studio 15.9.0 the issue returned. After IIS Express start web.config gets overwritten with added
<environmentVariable name="ASPNETCORE_HTTPS_PORT" value="44350" />line. If this matters, I have next configuration in launchSettings.json:"iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "https://localhost:44350/", "sslPort": 44350 } }