Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP Error 500.0 - ANCM In-Process Handler Load Failure #8134

Closed
robeverett opened this issue Mar 3, 2019 · 19 comments
Closed

HTTP Error 500.0 - ANCM In-Process Handler Load Failure #8134

robeverett opened this issue Mar 3, 2019 · 19 comments
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions feature-iis Includes: IIS, ANCM

Comments

@robeverett
Copy link

robeverett commented Mar 3, 2019

Still no resolution for this ?
Should we switch back to using core 2.1 for the time being ?

I added the changes to the Movie class (the Display and Column attributes)
after that I get the above error as soon as I try and navigate to:
https://localhost:44301/Movies.

It is only the Movies route that causes the 500 error, I can't find anything useful by placing breakpoints anywhere.

Various mentions online of web.config, but there IS NO web.config - only MvcMovie.csproj file and that is only available in the folder view, not in the Solution Explorer for some reason - even with the Show All Files button selected.

From my event log (if it helps):

Failed to start application '/LM/W3SVC/2/ROOT/movies', ErrorCode '0x80004005'.
Process Id: 15504.
File Version: 12.2.18292.0. Description: IIS ASP.NET Core Module V2. Commit:
b92c82e

There was another error at the same time:
Only one inprocess application is allowed per IIS application pool. Please assign the application '/LM/W3SVC/2/ROOT/movies' to a different IIS application pool.

(for some reason the github text editor truncates that token value above !!)

@robeverett
Copy link
Author

robeverett commented Mar 3, 2019

Update!!
Ok, hopefully this will help others stuck, because once again vital information was missing from a tutorial.

In VS2017, instead of running the app as IIS Express, I selected MvcMovie from the drop down options available near the green 'run' button.

This appeared to have the effect of selecting the "Project" commandName section of the launchSettings.json file (instead of "IISExpress") which indeed ties in with the tutorial which uses port 5001 (not 51687).
And now the app works fine.

Quite why the app should work properly when debugging from MvcMovie rather than IIS Express, I've no idea - perhaps someone could enlighten me.

The other odd thing is now a command window (black with white text) runs as well as the browser opening!

@muratg muratg added the feature-iis Includes: IIS, ANCM label Mar 7, 2019
@harveytriana
Copy link

The assignment of a separate app pool is a requirement when using the in-process hosting model.

That's it

@robeverett
Copy link
Author

So how is it the app only failes when the user navigates to the movies URL ?

@robeverett
Copy link
Author

robeverett commented Mar 14, 2019 via email

@thangchung
Copy link

I have got the same, just simply delete IIS config in the launchSettings.json file, run again, and it should work

@larserikfinholt
Copy link

We're getting same error msg. Application runs fine on IIS (2.2.2 inProcess) for about one week, now it suddenly started getting HTTP Error 500.0 - ANCM In-Process Handler Load Failure. A few minutes later the error dissapeared.
Nothing found in the logs.

#6111

@adrianknight89
Copy link

adrianknight89 commented Mar 23, 2019

I just started getting this issue from Azure Functions as all of my APIs (in consumption model) are hosted there. Pretty heartbreaking.

The error message I'm seeing is similar to the first post on #6111.

@joegithub
Copy link

Drive by Googling for this error led me here...posting my solution in case it can help anyone.
Seemingly out of the blue this issue happened to me. I could run my Core 2.2 API site in Debug in IIS Express, but when I tried to get to my swagger UI endpoint (just /swagger) I'd get the error page. My fix was to delete the VS config folder (a hidden folder in the solution folder), thus deleting the applicationhost.config file. Next time VS built the solution this was recreated, and my issue went away. When I diff the applicationhost.config file between a copy of the deleted one and the new one, I can see what could have caused the error. I had tried to set the default url for my site to be root/swagger, but I did this incorrectly in my project settings. I believe this resulted in the creation of a "swagger AppPool", which is present in the old config but not the new one.

@aydjay
Copy link

aydjay commented May 14, 2019

@GuitarHero1969 Thanks so much - was looking for ages to see what the issue was and choosing the "Project" instead of IIS express is what solved it.

@analogrelay
Copy link
Contributor

Thanks so much - was looking for ages to see what the issue was and choosing the "Project" instead of IIS express is what solved it.

This means the app is no longer using IIS. Is that a sufficient answer for everyone on this thread?

I'd like to try and get back to the underlying IIS issue:

Only one inprocess application is allowed per IIS application pool. Please assign the application '/LM/W3SVC/2/ROOT/movies' to a different IIS application pool.

It looks like @joegithub has identified that this issue is due to a corrupt applicationHost.config file. We believe this issue has been fixed in Visual Studio 2019 (cc @shirhatti to follow up).

I'm going to close this as we believe the underlying issue is resolved. If you are having a different issue, please feel free to file a new issue! If anyone is still having the above issue let us know.

@CesarD
Copy link

CesarD commented Jun 10, 2019

In my case, I experienced this error on Azure App Service.
My problem was that I was compiling the web app in x64 because I read in one of the Azure App Service instance properties that the OS was 64bits, but what I took long to realize (and it was shown in far less detail, but shown nonetheless), was that the IIS PROCESS on Azure App Service was being run in 32 bits. Thus, the assembly was not valid and that caused this error to be shown.

All in all, this particular error message can be the consequence of many different things.
It would be great to have more details instead of such a generic message.

@davidfowl
Copy link
Member

All in all, this particular error message can be the consequence of many different things.
It would be great to have more details instead of such a generic message.

That's being fixed.

cc @jkotalik

@analogrelay
Copy link
Contributor

analogrelay commented Jun 10, 2019

Yeah, in 3.0 we have a whole bunch of new detailed error codes. And in Development environment you'll get detailed errors messages right on the page (or in the Windows Event Log in non-Development environments). We're looking at how we can backport some of this to 2.1/2.2.

@Mincka
Copy link

Mincka commented Jul 6, 2019

I wanted to debug on a different URL than the index and I made the mistake to change the "App URL" in project settings from http://localhost:23009 to http://localhost:23009/OtherPage instead of changing the launchUrl (not the applicationUrl !) in launchSettings.json for the IIS Express profile.

It created a bunch of stuff, with a new app pool config for IIS Express and I had this error message after that when I tried to go back to "/OtherPage", after reverting to the default App URL.

I deleted all the references (3 blocks to remove) related to the additional app pool in WebApplication1\.vs\WebApplication1\config\applicationhost.config and it worked again.

Hope this helps. 😄

@OruamFernandes
Copy link

Well, after one day struggling with the "HTTP Error 500.0 - ANCM In-Process Handler Load Failure" my error was in one http call to another api and an extra dose of stupidity (localhost)..

using (var client = new HttpClient())
{
  client.BaseAddress = new Uri("http://localhost:55945");
   ...
  await client.GetAsync("api/pqp-oh-boi");
}

The way i endup discover my error was through console Kudu. You can access it via Azure or directly by https://YOUR-SITE.scm.azurewebsites.net/ . Once in the main page, i went to Debug console/CMD then site/wwwroot and edit the web.config file.

I set the value of stdoutLogEnabled to true, went back to my directory and access "LogFiles" were I can check for my error.
<aspNetCore processPath=".\Uno.ContactManager.RestApi.exe" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout" hostingModel="InProcess" />

As @CesarD said

All in all, this particular error message can be the consequence of many different things.

Hope this can help someone

@juniormayhe
Copy link

I closed Visual Studio and deleted hidden .vs folder and now swagger is working again on netcore 2.2

@omaraceves
Copy link

Deleted .vs FTW! Thanks for sharing your solution @joegithub !

@Tailslide
Copy link

It looks like @joegithub has identified that this issue is due to a corrupt applicationHost.config file. We believe this issue has been fixed in Visual Studio 2019 (cc @shirhatti to follow up).

I'm going to close this as we believe the underlying issue is resolved. If you are having a

FYI I am still getting this in Visual Studio 2019 and the solution still works.

@18549
Copy link

18549 commented Sep 16, 2019

Just got the exact same error as @joegithub in VS2019 16.2.3 while adding IdentityServer4 to an ASP core webservice and adding /.well-known/openid-configuration to the project path.

Doesn't appear to be fixed in VS2019 yet.

EDIT: Full disclosure. The error only occurs if you add your desired endpoint path to the 'App URL' field in Project Properties instead of adding it to the 'Launch Browser' path field. However, once you've made that mistake it's extremely difficult to work out what's gone wrong. Cudos to @joegithub for such a well described fix, he's clearly saved a lot of people a lot of time and effort.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions feature-iis Includes: IIS, ANCM
Projects
None yet
Development

No branches or pull requests