3
votes

We migrated one of many ASP.Net Core 2.2 Apps to .NET Core 3.0. The application runs fine on the developer machine.

When I run it on the production server (IIS) I am keep getting HTTP Error 500.30. I tried to turn on stdout Log for more information but it only creates an empty folder without any logfiles. Also in the event log are no useful information about any errors.

However the application runs fine on the IIS when I run it OutOfProcess. Since our application is rather big and hard to track down any errors I created a default MVC web application without authentication. I deployed this application on the same IIS server and I am getting the exact same behaviour - it runs OutOfProcess but failes with InProcess.

Has anyone a suggestion to resolve this issue? I also found several entries on github but didn't help.

Edit - Additional information

I created a folder publish profile in VS2019 with Release configuration, target framework netcoreapp3.0, deploymentMode: Framework-Dependent and TargetRuntime: win-x86.

On the IIS I've installed the ASP.NET Core/.NET Core: Runtime & Hosting Bundle.

4
Without more information there's really not much we can do. What you could try is to enable detailed exception pages in your production environment to try and get some more details from the error.fredrik
How is app pool configured ? it must be 32 bit in your case. The architecture (bitness) of the app and installed runtime (x64 or x86) must match the architecture of the app pool docs.microsoft.com/en-us/aspnet/core/host-and-deploy/…alexm
@alexm I just went through the documentation of microsoft and found that flag. Enabled it and it works! But why did it work with core 2.2 with the same application pool and also x86?Skuami
@Skuami can you please share the link to the documentation? or would be even better if you could please answer your own question with complete steps. I am also in the exact same situation.And should the app pool be always 32bit or can it also be win-x64?Naveed Ahmed

4 Answers

3
votes

I have faced a similar kind of issue. Below is the step which I follow to resolve the issue.

  1. In the server run the below command in the command prompt after going to the deployed folder

    dotnet project_name.dll

  2. It shows the actual error.

In my case, I forgot to create the folder which was mentioned in appsettings.json.

Hope it will help you to find the actual issue.

2
votes

I found the solution to my problem in the ASP.NET Core 3.0 (or now 3.1) documentation: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.1#create-the-iis-site

By default the application pool on IIS runs as 64-bit. If you compile the application for any cpu, that doesn't matter. But if the application is compiled explicitly for 32-bit, the web app will crash.

Enable the 32-bit mode in the advanced settings on the application pool:

enter image description here

0
votes

I got this going from ASP.Net Core 2.1 to 3.0. For me, the problem was the specification of

 hostingModel="InProcess"

in the web.config file. I removed that and it was all good. BTW: I couldn't get anything in the stdout log for some still unknown reason.

0
votes

I have encountered the same problem error after deployment to Azure. After successful deployment, the web app was not started.

Then I have checked deployed files for more detailed error message via Kudu (you can use App Service > Advanced Tools>DebugConsole Menu or https://.scm.azurewebsites.net/DebugConsole )

For more information you can read from this article.

After checking, I had only Response status code does not indicate success: 401 (Unauthorized) error message which is not clear enough.

In my case, I was using the App registry in order to use Azure AD Auth. The missing part was related to missing access rights to my app registry on app service plan.

After giving contributor access and then restarting the app, it was solved.