From this morning without any changes to the code of the project, a very simple Web API, one controller and 3 methods, with Swagger, it doesn\'t start anymore and I get the
Thanks to @Lex Li he has given me the solution.
The issue was in the applicationhost.config, the metabase file containing all the settings for the IISExpress launch by Visual Studio to run your web application.
For Visual Studio 2019, this file is located in
$(solutionDir)\.vs\{projectName}\config\applicationhost.config
For other version check this post: Where is the IIS Express configuration / metabase file found?
under the section I had the following:
<sites>
<site name="WebSite1" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":8080:localhost" />
</bindings>
</site>
<site name="MyProjectName" id="2">
<application path="/" applicationPool="MyProjectName AppPool">
<virtualDirectory path="/" physicalPath="E:\Projects\MyProjectName" />
</application>
<application path="/docs" applicationPool="docs AppPool">
<virtualDirectory path="/" physicalPath="E:\Projects\MyProjectName" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:59386:localhost" />
<binding protocol="https" bindingInformation="*:44345:localhost" />
</bindings>
</site>
<siteDefaults>
<!-- To enable logging, please change the below attribute "enabled" to "true" -->
<logFile logFormat="W3C" directory="%AppData%\Microsoft\IISExpressLogs" enabled="false" />
<traceFailedRequestsLogging directory="%AppData%\Microsoft" enabled="false" maxLogFileSizeKB="1024" />
</siteDefaults>
<applicationDefaults applicationPool="Clr4IntegratedAppPool" />
<virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>
Where there are some strange setting defined by
<application path="/docs" applicationPool="docs AppPool">
<virtualDirectory path="/" physicalPath="E:\Projects\MyProjectName" />
</application>
that has been certainly added when I've tried to set as start folder the /docs path.
Commenting out this setting and another one at the end of the file related to this path has solved the issue.
I fixed the issue by deleting V2 in web.config file generated after publishing the solution.
<handlers>
<add name="aspNetCore" path="*" verb="*"
modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
instead of
<handlers>
<add name="aspNetCore" path="*" verb="*"
modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
It's currently a bug in VS2019 - (Nov 4 '2019)
1.) Close your solution
2.) Delete applicationhost.config
in folder .vs
or delete the whole .vs
folder.
The .vs
is a hidden folder and is next to your solution file usually.
3.) Restart your solution again
I got the same error when I did the following:
Problem:
Since both my sites are under "Default Web Site" they are both using DefaultAppPool, which is the cause of this error. The same error occurs when the sites are not under "Default Web Site" but use the same app pool.
Solution:
As mentioned in the docs,
To fix this error, run apps in separate IIS application pools.
for me this problem was resolved when I started using separate app pools for each site.
I had the same problem.
Add this line in .csproj file in Tag:
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel
>
Although it is the 500.30 error it also fixed the 500.35 problem.
HTTP Error 500.30 - ANCM In-Process Start Failure
I hope help you.
Best regards.
In .csproj
file, set:
<PropertyGroup>
...
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
</PropertyGroup>
Allow host the same pool