I have just upgraded our ASP.NET Core 2.2 web application to 3.0. It builds and deploys fine. The problem is when I go to run it from our IIS server. This was running perfectly fine as a Core 2.2 web app, but now fails since upgrading to Core 3.0.
When I launch the web app from the commandline there are no reported errors.
When I launch the application from the browser the Windows logs indicate that the app started correctly.
The app then fails with an HTTP 500 error. Here are the IIS log entries.
We're using Windows Server 2012 R2 with IIS 8.5.9600.16384
The app appears to start correctly but then fails with an HTTP 500 error. Has anyone else seen this or something similar? Any ideas how to diagnose / fix the problem?
UPDATE
I've attached the VS 2019 debugger to the deployed app via the w3wp.exe process and it's not even hitting any of the middleware (I have a breakpoint at Startup() in Startup.cs).
I've tried changing the application pool settings e.g. identity, .NET version but to no avail.
When I launch the site from the web server I get the following error message which doesn't really tell me anything.
I can't see what's causing the problem.
.NET Core 3.0 uses the in-process hosting model by default. You may need to upgrade the .NET Core Hosting Bundle.
You will check web.config "aspNetCore"
<aspNetCore processPath="dotnet" arguments=".\Api.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
maybe proccessPath is wrong.
if it doesn't solve problem , write to log step step startup.cs.
Maybe throw error in startup.cs
After investigation and comparison of the build artifacts that the build produces vs the deployed app, I discovered that the appsettings.json was not being deployed. No idea how or when this started failing, but it caused the app to generate an HTTP 500 error message. Our app's Azure ADB2C settings are contained in this file so it was crashing trying to authenticate but couldn't find the authentication settings.
There was no obvious error being generated and everything seemed to be loading fine. It was at the point at which the app was trying to authenticate that it was failing. All working now.
Related
I'm working on an ASP.NET Core 6 site and I usually use kestrel to run and debug the application. Today I've deployed the app to IIS but after one or two requests IIS stop responding and only return
HTTP Error 503.0 - Server has been shutdown
Same behaviour with IIS Express. Everything works fine with kestrel.
I don't know how to debug the problem, I've attached the debug but with no luck. I've also looked at stdout log but nothing appears.
Does anybody have any suggestions on how to debug the issue ?
Please follow my step to collect the dump files. And if want analyze the dump files you can create a new post and ask for help. This answer just tell you how to debug issue.
First Way
Remote debug with visual studio 2022
Deploy your app to IIS.
Run your VS2022 with administrator and attach the process.
Reproduce the issue to check the issue.
Second Way:
Collect dump files
If the first method can't reproduce or debug the issue.
You can follow below steps to collect the dump.
Download and install Debug Diagnostic Tool v2 Update 3.1
Deploy your webapp in IIS
Set rules to collect dumps by using DebugDiag or Collect dumps manually
After upgrading an application from .NET Core 1.0 to 2.1, I am receiving the following error when I try to debug it with IIS Express:
Unable to start process C:\Program Files\dotnet\dotnet.exe. The web server request failed with status code 502, Bad Gateway.
However, this only happens every second time I launch the application. Otherwise it works just fine if I just launch it again.
This creates a mild nuisance to my debugging process, as I constantly have to keep closing the error windows popping up.
The full response shows some additional info:
HTTP Error 502.3 - Bad Gateway
The specified CGI application encountered an error and the server terminated the process.
And the error code "0x80072efe" is shown.
Logging is enabled in web.config, but the crashing launches are not shown at logs at all. I have also tried looking Event Viewer for additional information, but I have not found anything.
The only fix for this I have found so far is to set Kestrel use libuv instead of sockets, but I have no idea why it works. Does anyone have any idea how to fix this?
I encountered the same problem after I upgraded, regardless of what I did it would always show the 502 error on the second load. It appears this problem was introduced in ASP.NET Core 2.1. I tracked it down to the asp-prerender-module tag in my view. Remove the prerender and it goes away.
I was able to fix the problem and keep my prerendering by upgrading to ASP.NET Core 2.2.
I've been working on a new MVC 4 application and in the development environment everything has been working correctly, yet after deploying to our production environment I've found that my WebApi's no longer resolve and as a result I'm only getting 404's when I try to use my api's
I've checked my web.config and I can't find anything that's as miss and I've made sure that I've got the following in my web.config
<modules runAllManagedModulesForAllRequests="true"></modules>
however this is not helping either.
I've also in an attempt to make sure that the server would run the MVC 4 project I've even installed the MVC4 framework which has not helped either.
I created a MVC 4 Web Api and ran all the configurations to get it running, but I get the error mentioned above.
The event log says I am running two version of .NET
I have enabled 32 bit applications on the server
This is the proof of .NET 4 Registration:
This is the error I am getting:
The setup for above error:
Clicking on configure from above screen:
Clicking on edit:
If I change the wildcard mapping dll to the follwing
I get this error, as you can see it says I am running version 2 of .net which is not true according to the first screenshot, I have tried iisreset to not avail:
The wild card mappings are used for clean url's when using MVC 4 web api.
This is the setup in IIS:
Can someone maybe guide me to a solution for this?
EDIT:
These are the resources for the initial setup I did:
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
http://johan.driessen.se/posts/getting-an-asp.net-4-application-to-work-on-iis6
Basically the IIS has framework 4 registered but it is using framework 2 when I try and load the api.
The last couple of days I've been trying to deploy MVC 4 applications to IIS 7.5 and 8 installations on Server 2008 R2 and 2012, but I'm basically getting the same error every time: 404 and "The controller for path '/' was not found or does not implement IController." On both servers I've made sure that .NET 4, 4.5 and the full MVC 4 stack are installed. The applications run fine on IIS Express in VS 2012.
Things I've tried and results:
Tried to deploy a clean MVC 3 applicaion: works;
Tried to deploy a clean MVC 4 application: doesn't work;
Tried to deploy a clean ASP.NET 4 WebForms application: works (which, I think, rules out the ASP.NET hosting capabilities being a problem);
Tried to deploy the MVC 4 apps with .NET 4 instead of 4.5: doesn't work (which, I think, rules out the .NET installations being the problem);
Tried to install hotfix 980368: installer says 'This update is not applicable to your computer', so that is probably already installed;
Made sure the app pool is on .NET 4.0;
Made sure all file permissions are setup properly;
Changed verbs on ExtensionlessUrlHandler-Integrated-4.0 to *;
Added the <modules runAllManagedModulesForAllRequests="true" /> tag.
But still no dice... I've read many SO questions and other websites which resemble the errors I'm getting, and I think I've tried all the tips I've read, but maybe I missed a crucial one.
Has anyone else experienced these problems, that can give me the fix I need?
Right, as it seems, adding the debug symbols (.pdb) to the bin folder makes the app start working again, even though it was deployed in Release mode. I'll do some research as to why this happens.
Edit: the answer can be found here: Removing .pdb from ASP.NET app on IIS breaks application