Ошибка 500 asp net core

:( Oops.
500 Internal Server Error
An error occurred while starting the application.

This message came out when I added database functionality to my asp.net core app and deployed it to iis. When I developed it in Visual Studio, everything went well. But after deploying, this error messages appeared.

I tried to use dotnet myapp.dll to run my app in the deploy folder, and found out it worked well. It is likely that the problem is relation to iis. I tried to add <compilation debug="true">..</compilation> to web.config, but it seems useless. What is problem are actually, or is there any other way to see the detailed error info to help find out what’s happened?

asked Sep 30, 2016 at 7:14

yitian's user avatar

4

  1. Change stdoutLogEnabled=»false» to true and then check the logs at stdoutLogFile=».logsstdout». The error(s) there might tell you something.

  2. Check that you set up right Environment Name using ASPNETCORE_ENVIRONMENT environment variable as so use correct settings like connection string. On your machine by default you have «Development» environment.

  3. You may use Error Handling middlewares for showing exceptions like

    app.UseDeveloperExceptionPage();
    

answered Sep 30, 2016 at 7:49

Set's user avatar

SetSet

47.1k22 gold badges132 silver badges149 bronze badges

1

Had the same issue. Here is the guide that helped me. Note, that I did not want to install the «Runtime» on the web server, but rather deploy all the necessary files as a stand alone app. Below are the steps in a more abbreviated form:

  1. On your local PC, Determine which version to publish based on your server. I was targeting Windows Server 2008, R2 which meant i needed to publish win7-x64. Open a command prompt in your project directory and run the command below:

    dotnet publish -c release -r win7-x64

    This creates a publish folder containing hundreds of dlls, an .exe, and web.config located here: binReleasenetcoreapp2.0publish

  2. On the web server with IIS, go to this landing page. Click the link for your desired version. Find the link for the Runtime and Hosting Bundle. Click to download and run.

  3. Restart IIS by running this from an elevated command prompt:

    net stop was

    net start w3svc

  4. Copy all of the files in your local publish folder to your desired application folder on the IIS server.

  5. On the server, Open IIS, and create a separate AppPool and Application like normal. For the AppPool, under Basic Settings, change the .NET Framework version to No Managed Code. Make sure your Application in IIS points to your desired folder and the proper AppPool.

  6. Test your web application in a browser.

Beakie's user avatar

Beakie

1,9383 gold badges19 silver badges45 bronze badges

answered May 10, 2018 at 14:16

James Lawruk's user avatar

James LawrukJames Lawruk

29.7k19 gold badges130 silver badges137 bronze badges

1

In my case, I got this because I hadn’t actually installed the latest ‘DotNetCore.2.0.0-WindowsHosting.exe’ on the windows server I was running it on… so it was working fine on my local machine in debug and error five hundy’ing on the server.

I had other non trivial to fix issues with the upgrade also… I’d advise avoiding it if you can.

answered Sep 4, 2017 at 13:14

David van Dugteren's user avatar

1

Mark333’s comment below solved my problem.

Quoting for easy reading:

«I’m using the normal publish provided by Visual Studio. And, I just
found out using the latest version of Hosting Bundle will fix the
issue. +1 on this
microsoft.com/net/download/dotnet-core/runtime-2.1.0-rc1»

I had to install for 1.1 since my app is a little older, but Hosting Bundle fixed it. In my case we deploy to a Docker image for our official environment, but when I want to do some testing locally I publish it and let my local IIS serve it up.

answered Aug 28, 2018 at 13:49

Matthew Allen's user avatar

Matthew AllenMatthew Allen

5392 gold badges7 silver badges14 bronze badges

Shiv Bachan's user avatar

answered Feb 21, 2019 at 13:00

Diego Venâncio's user avatar

Diego VenâncioDiego Venâncio

5,5892 gold badges49 silver badges67 bronze badges

2

Make sure the App Pool has permissions to the folder where your app resides.

answered Nov 10, 2020 at 14:25

tno2007's user avatar

tno2007tno2007

1,90325 silver badges16 bronze badges

I had installed DotNetCore.2.0.5-WindowsHosting.exe on a Windows 2008 R2 Standard machine and encountered the same http 500 error. Logging didn’t help (blank logs were generated — and Event Viewer logs were the generic ErrorCode = 0x80070002)

I had to do two things to solve my problem:

  1. Give Read rights to the ApplicationPoolIdentity user (EG: IIS APPPOOLAppPoolIdentityName) to the website directory and the application directory
  2. I had to install IIS ASP Core under Server Manager (this felt weird, but it worked!)

answered Jan 19, 2018 at 3:36

Rots's user avatar

RotsRots

5,5063 gold badges43 silver badges51 bronze badges

1

I had the same issue.

My problem was that my connection string to db was not set in appsettings.production.json

And the internal server error 500 was to vague error message.

Changing the stdoutLogEnabled = true did nothing to me so i was not seeing any information about the error.

answered Aug 12, 2018 at 7:01

Dongolo Jeno's user avatar

1

I experienced this issue. The problem was due to my local Sql Server instance. Remote connection were not allowed. So I manually restarted the SQL instance and my App restarted working fine.

answered Sep 20, 2019 at 7:13

DOUMBIA Mamadou's user avatar

I had similar issue after istalling dotnetcore-windowshosting using chocolatey while doing AWS ec2 instance bootstrapping.

When I checked my IIS modules AspNetCoreModule was missing.

This solved my issue. https://github.com/aspnet/IISIntegration/issues/434

I had to uninstall chocolatey package, restart machine and install it again.

Hope this helps!

answered Nov 1, 2019 at 5:31

prashant's user avatar

prashantprashant

2,1812 gold badges22 silver badges37 bronze badges

In my case, I created a .NET 5 single file output, and I was getting:

500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.

The problem turned out to be that the EXE file was for some strange reason recognized as a virus by the protection software (CrowdStrike Falcon). Re-building without «single file output» option solved that problem.

answered Dec 13, 2021 at 17:29

Mr. TA's user avatar

Mr. TAMr. TA

5,20027 silver badges35 bronze badges

It also happens when you install dotnet-hosting-bundle/dotnet runtime beofore IIS.

In this case re-install dotnet-hosting-bundle/dotnet runtime.

answered Mar 22, 2022 at 7:36

gartenkralle's user avatar

gartenkrallegartenkralle

6461 gold badge11 silver badges21 bronze badges

To be able to see the excetion’s detail I just needed to change the ASPNETCORE_ENVIRONMENT to «Development» in the «IIS Express» profile in the launchSettings.json file. I aldo needed to create the corresponding appsettings.Development.json file to set the variables and data needed in my App. When the environment is Development net core send the detail exception by defaul. As we can read here in the official documentation.

answered Aug 10, 2022 at 14:44

Daniel Silva's user avatar

Problems during the startup of an ASP.NET Core project on your production environment can be extremely hard to debug. In this article, I’ll guide you through where to look and possible solutions to common startup problems.

HTTP Error 500.30 - ASP.NET Core app failed to start help

So, you spend days developing the next Facebook or Twitter in ASP.NET Core. Everything works out on your machine and after deploying your site to the production environment, all you get is this error in the browser:

HTTP Error 500.30

As stated in the headline, the ASP.NET Core failed to startup. This means that something happened during the initialization of your app, why you won’t even be able to launch any of your web pages. This page is sometimes referred to as the White Screen of Death, a spin on the Blue Screen of Death in Windows and the Yellow Screen of Death in ASP.NET.

Here is a list of actions to run through, to help to figure out what went wrong. Not all of the actions may be applicable or even possible in your case.

Enable developer exception page

This is probably the fastest way to get some more details of the error happening. When working locally and errors happen, you get a much more detailed message in the browser. This is because of a piece of middleware part of ASP.NET Core named DeveloperExceptionPage. Open the Startup.cs file and locate the call to UseDeveloperExceptionPage:

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    if (env.IsDevelopment())
    {
        app.UseDeveloperExceptionPage();
    }
    else
    {
        app.UseExceptionHandler("/Home/Error");
    }
    
    // ...
}

This is the code as it looks when creating a new ASP.NET Core from the default template. Yours may or may not look similar. The task here is to only use the developer exception page by replacing the code above with:

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    app.UseDeveloperExceptionPage();
    
    // ...
}

This will show the developer exception page on both your local environment as well as production. This solution is only applicable before you get real users in your production environment. You never want to leak internal information from your application on an error page, when real users (and potential hackers) can access your site. Also, remember to switch back to the previous code once you have found the cause of the error.

Enable logging

Depending on how far ASP.NET Core has gotten before breaking down, you may be in luck and the error is logged as part of Microsoft.Extensions.Logging. To enable logging from your website, start by opening the Program.cs file and call the ConfigureLogging method like this:

public static IHostBuilder CreateHostBuilder(string[] args) =>
    Host.CreateDefaultBuilder(args)
        .ConfigureWebHostDefaults(webBuilder =>
        {
            webBuilder.UseStartup<Startup>();
            webBuilder.ConfigureLogging((ctx, logging) =>
            {
            });
        });

Next, you will need to choose a destination for the log messages generated by ASP.NET Core. Since the error is happening on a remote web server, you will need some kind of persistent storage like a file, a database, a cloud logging service (like elmah.io), or similar. Let’s start with logging to the Windows Event Log by including the following code inside the action provided for the ConfigureLogging method:

logging.AddEventLog(options =>
{
    options.SourceName = "MyApp"; 
});

This will log all warnings and up to the Application log with a Source named MyApp. You can filter events using that source through the Event Viewer application in Windows.

In case you are hosting on Linux or Mac, the event log solution won’t be available. There, you will need to find an alternative (like a database). Microsoft.Extensions.Logging supports a range of logging targets either natively or through third-party packages available on NuGet.

I quickly want to mention the elmah.io integration for Microsoft.Extensions.Logging. Setting up logging only requires a few lines of code inside the ConfigureLogging method:

logging.AddElmahIo(options =>
{
    options.ApiKey = "API_KEY";
    options.LogId = new Guid("LOG_ID");
});

Once you have signed up for elmah.io, the real values to use instead of API_KEY and LOG_ID will be available through the elmah.io UI.

In some cases, problems occur before initializing the logging framework. ASP.NET Core provides some simple file logging through the web.config file. To enable file logging, add the following to your web.config file:

<system.webServer>
  <aspNetCore /* ... */ stdoutLogEnabled="true" stdoutLogFile=".logsstdout" />
</system.webServer>

This will create a log file named stdout followed by a rolling id in a logs folder in the root of the project. If the file is empty after running the failing endpoint, you can enable additional debug logging like this:

<system.webServer>
  <aspNetCore /* ... */>
    <handlerSettings>
      <handlerSetting name="debugFile" value=".logsaspnetcore-debug.log" />
      <handlerSetting name="debugLevel" value="FILE,TRACE" />
    </handlerSettings>
  </aspNetCore>
</system.webServer>

This will create a file named aspnetcore-debug.log in the same folder as explained above. For both the stdout and the aspnetcore-debug.log file, this is recommended for debugging problems on localhost only. In other words, don’t enable this in your production environment.

When running the site on your local machine, detailed log output similar to the debug log file specified above is available in the Output window inside Visual Studio. Make sure to select Debug in the Show output from the drop-down:

Log output

If running on Microsoft Azure, something similar can be viewed in the Application Event Logs tool available here:

Application Event Logs

Remote debug the application

ASP.NET Core supports remote debugging, meaning that you can attach a debugger running on your developer machine to the site running on the production environment.

To debug a remote site, you will need to carry out the following steps:

  • Download the Remote tools matching your Visual Studio version here: https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging-aspnet-on-a-remote-iis-computer?view=vs-2019#BKMK_msvsmon.
  • Install Remote tools on the server running the webserver.
  • Make sure to either disable the firewall on the webserver or allow incoming connections on port 4024.
  • Launch Remote Debugger as Administrator (👈 important).

Visual Studio Remote Debugger

  • Launch the website in Visual Studio on your developer machine and select Debug | Attach to process.
  • Fill in the form like this, but replace the hostname with the name of the server running the webserver:

Attach to Process

  • Click the Attach button and you will be able to debug the remote application.

This was just a quick walkthrough. For the full documentation, check out Microsoft’s documentation here: https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging-aspnet-on-a-remote-iis-computer?view=vs-2019.

Validate the appsettings.*.json files

A common problem for startup problems with ASP.NET Core is an invalid appsettings.json and/or appsettings.Production.json. It could be either a JSON syntax problem, a problem with the content within the config file, or a problem when transforming values from the appsettings.Production.json file into appsettings.json.

I will recommend you to grab both the appsettings.json and appsettings.Production.json (if any) files from the server and do the following for both files:

  • Validate the JSON with this JSON Formatter and Validator.
  • Validate the content of the JSON file with this Appsettings.json Validator.

Also, make sure to verify that the changes in the appsettings.Production.json file look correct using this Appsettings.json Transformation Tester.

elmah.io: Error logging and Uptime Monitoring for your web apps

This blog post is brought to you by elmah.io. elmah.io is error logging, uptime monitoring, deployment tracking, and service heartbeats for your .NET and JavaScript applications. Stop relying on your users to notify you when something is wrong or dig through hundreds of megabytes of log files spread across servers. With elmah.io, we store all of your log messages, notify you through popular channels like email, Slack, and Microsoft Teams, and help you fix errors fast.

elmah.io app banner

See how we can help you monitor your website for crashes
Monitor your website

User-1158769213 posted

Hello,

I’m just starting with ASP.NET Core, and tried to deploy one today. I was faced with the above error when I tried to load it.

I started VS2017, created a new MVC Core site, and published. I didn’t change a thing, just published the site as it came out of the box.

I then copied the contents of the binReleasenetcoreapp2.2publish folder to my hosting company via FTP, and tried to load the site in a browser.

The hosting company installed Core 2.2 on the server. Do they need to do anything else? I only have control panel access (via SolidCP) to the server, not remote access, so there’s only so much I can do.

If I look in my control panel for the site, I see the following warning…

System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. —> System.Runtime.InteropServices.COMException: Filename: \?D:HostingSpacestestusertest.mydomain.co.ukwwwrootweb.config 
Error: 

at Microsoft.Web.Administration.Interop.AppHostWritableAdminManager.GetAdminSection(String bstrSectionName, String bstrSectionPath) 
at Microsoft.Web.Administration.Configuration.GetSectionInternal(ConfigurationSection section, String sectionPath, String locationPath) 
at SolidCP.Providers.Web.Iis.DirectoryBrowse.DirectoryBrowseModuleService.GetDirectoryBrowseSettings(ServerManager srvman, String siteId) 
at SolidCP.Providers.Web.IIs70.FillAppVirtualDirectoryFromIISObject(ServerManager srvman, WebAppVirtualDirectory virtualDir) 
at SolidCP.Providers.Web.IIs70.GetSite(String siteId) 
at SolidCP.Providers.Web.IIs80.GetSite(String siteId) 
at SolidCP.Server.WebServer.GetSite(String siteId) 
— End of inner exception stack trace — 
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) 
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) 
at SolidCP.Providers.Web.WebServer.GetSite(String siteId) 
at SolidCP.EnterpriseServer.WebServerController.GetWebSite(Int32 siteItemId) 
at SolidCP.EnterpriseServer.esWebServers.GetWebSite(Int32 siteItemId) 
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) 
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) 
at SolidCP.EnterpriseServer.esWebServers.GetWebSite(Int32 siteItemId) 
at SolidCP.Portal.WebSitesEditSite.BindWebSite()

The web.config file it mentions looks like this…

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".BasicCoreSite.dll" stdoutLogEnabled="false" stdoutLogFile=".logsstdout" hostingModel="InProcess" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: 2fbe438c-a8b2-4b5b-8224-eb5dfcb62107-->

I tried changing the value of stdoutLogEnabled to «true» to see if that would give me a log file, but I couldn’t see anything appear.

Anyone any idea what went wrong? The hosting company don’t know much about Core, so can’t help.

Thanks for any help you can give.

We are going to explore four potential reasons why your ASP.NET Core Application is not working in IIS.

Now the reason why I’m writing this article is because I’ve had a few people get in contact with me as a result of my article «How to Publish an ASP.NET Core & React SPA to IIS».

They were saying they still couldn’t get their ASP.NET Core application to work in IIS, despite following the recommendations in that article.

So, that’s explore the reasons why this might be the case and come up with some rememdies.

Problem #1: Permissions

So you’ve published your ASP.NET Core application. You’ve set up a website in IIS pointing to your published folder.

Tried to run the application. And then IIS throws an error that reads as follows:

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

Config Error: Cannot read configuration file due to insufficient permissions

500.19 Error when Running an ASP.NET Core Application in IIS

500.19 Error when Running an ASP.NET Core Application in IIS

This error is because IIS does not have the correct permissions to render your ASP.NET Core application.

In Windows 10, you need to give full access to the IIS_IUSRS group in the path where you are hosting your ASP.NET Core application in IIS.

Learn Blazor WebAssembly with our online courses

Give IIS_IUSRS Full Control to your ASP.NET Core Application in IIS

In Windows 10, give IIS_IUSRS Full Control to your ASP.NET Core Application in IIS

This should resolve your issue.

However, what if that group is not there? Or it doesn’t resolve the issue?

If the group is not there, you can add the Users group to the folder that’s running your ASP.NET Core application in IIS. And give it full permission. That should at least get your application working.

But, it might be that you’ve changed the identity of the application pool in IIS. You might be running your IIS application from a different user.

In which case, in IIS, go to Application Pools and click on the pool running your application.

Go to Advanced Settings… and navigate to Process Model and Identity.

Check the Application Pool Identity in IIS when running an ASP.NET Core Application

Check the Application Pool Identity in IIS when running an ASP.NET Core Application

If you are using a Custom Account, you will probably need to give full permissions to that account as well.

Problem #2: Installing ASP.NET Core Runtime

If you are running an ASP.NET Core application, you must install ASP.NET Core Runtime onto the machine that is running your application through IIS.

You can download ASP.NET Core Runtime from Microsoft’s ASP.NET Core website. It will give you different installers dependent on which operating system you are using.

For IIS, it’s recommended that you install the Hosting Bundle. Not only does this install ASP.NET Core Runtime, but also additional support for IIS runtime support.

Download ASP.NET Core Runtime Hosting Bundle for Windows

For IIS, download the Hosting Bundle from the Windows OS to download ASP.NET Core Runtime & additional IIS runtime support

Problem #3: Different ASP.NET Core Runtime Version

It’s easily done. You’ve successfully deployed your ASP.NET Core application onto IIS and everything is fine.

That is until you upgrade your ASP.NET Core version. You try and deploy it to IIS and then you get a 500 error.

Here is an example of trying to run an ASP.NET Core 3 application with ASP.NET Core Runtime 1 installed.

The error reads:

HTTP Error 500.21 - Internal Server Error
Handler "aspNetCore" had a bad module "AspNetCoreModuleV2" in its moudle list

500.21 Error when Running an ASP.NET Core 3 Application with ASP.NET Core Runtime 1

500.21 Error when Running an ASP.NET Core 3 Application with ASP.NET Core Runtime 1

Now I must stress that you might not get any error when you upgrade your ASP.NET Core version for your application without upgrading your ASP.NET Core Runtime.

But, it’s worth keeping it up to date.

Problem #4: A Runtime Error With Your Application

This one was raised by Chaker Aich on my YouTube channel.

So you’ve tried all these solutions, but you are still getting a 500 error.

This one is more specific as it relates to a start up failure.

HTTP Error 500.30 - ANCM In-Process Start Failure

500.30 Error when Running an ASP.NET Core Application in IIS

500.30 Error when Running an ASP.NET Core Application in IIS

This is a problem with your ASP.NET Core application rather than IIS. There is a runtime error.

First, check that it runs locally on your machine. Assuming you are using Visual Studio, open the application in Visual Studio and run the application.

If it throws an error, you will know the reason why you are getting a 500.30 error in IIS.

However, if it’s working fine, there is probably something wrong with the IIS environment. Maybe the server cannot see the database? Or maybe, there is something that hasn’t been installed on the server?

To help you identify the issue, you can turn on log files.

In the directory that is running your ASP.NET Core application in IIS, you should have a web.config file.

In there, you should have an aspNetCore tag with a stdoutLogEnabled and stdoutLogFile attribute.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".RoundTheCode.ReactSignalR.dll" stdoutLogEnabled="false" stdoutLogFile=".logsstdout" hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>

Now the stdoutLogEnabled attribute should be set to false. By setting that to true, you should be able log the runtime error that you are getting in your application.

The log files are stored in the folder path that is contained in the stdoutLogFile attribute.

Still Stuck?

If you are not quite following the solutions to the fixes, you can watch us demonstrate these errors and applying fixes.

We go ahead and publish our ASP.NET Core application to a folder, ready for IIS to host.

Afterwards, we set the appropriate permissions that IIS needs to render your ASP.NET Core application.

Then, we go ahead and install the ASP.NET Core Runtime onto our machine.

Lastly, we demonstrate the checks you can use to deal with any runtime errors you are getting when running your ASP.NET Core application in IIS.

title author description monikerRange ms.author ms.custom ms.date uid

Common error troubleshooting for Azure App Service and IIS with ASP.NET Core

rick-anderson

Provides troubleshooting advice for the most common errors when hosting ASP.NET Core apps on Azure Apps Service and IIS.

>= aspnetcore-2.1

riande

mvc

3/07/2022

host-and-deploy/azure-iis-errors-reference

Common error troubleshooting for Azure App Service and IIS with ASP.NET Core

:::moniker range=»>= aspnetcore-2.2″

This topic describes the most common errors and provides troubleshooting advice when hosting ASP.NET Core apps on Azure Apps Service and IIS.

See xref:test/troubleshoot-azure-iis information on common app startup errors and instructions on how to diagnose errors.

Collect the following information:

  • Browser behavior such as status code and error message.
  • Application Event Log entries
    • Azure App Service: See xref:test/troubleshoot-azure-iis.
    • IIS
      1. Select Start on the Windows menu, type Event Viewer, and press Enter.
      2. After the Event Viewer opens, expand Windows Logs > Application in the sidebar.
  • ASP.NET Core Module stdout and debug log entries
    • Azure App Service: See xref:test/troubleshoot-azure-iis.
    • IIS: Follow the instructions in the Log creation and redirection and Enhanced diagnostic logs sections of the ASP.NET Core Module topic.

Compare error information to the following common errors. If a match is found, follow the troubleshooting advice.

The list of errors in this topic isn’t exhaustive. If you encounter an error not listed here, open a new issue using the Content feedback button at the bottom of this topic with detailed instructions on how to reproduce the error.

[!INCLUDEAzure App Service Preview Notice]

OS upgrade removed the 32-bit ASP.NET Core Module

Application Log: The Module DLL C:WINDOWSsystem32inetsrvaspnetcore.dll failed to load. The data is the error.

Troubleshooting:

Non-OS files in the C:WindowsSysWOW64inetsrv directory aren’t preserved during an OS upgrade. If the ASP.NET Core Module is installed prior to an OS upgrade and then any app pool is run in 32-bit mode after an OS upgrade, this issue is encountered. After an OS upgrade, repair the ASP.NET Core Module. See Install the .NET Core Hosting bundle. Select Repair when the installer is run.

Missing site extension, 32-bit (x86) and 64-bit (x64) site extensions installed, or wrong process bitness set

Applies to apps hosted by Azure App Services.

  • Browser: HTTP Error 500.0 — ANCM In-Process Handler Load Failure

  • Application Log: Invoking hostfxr to find the inprocess request handler failed without finding any native dependencies. Could not find inprocess request handler. Captured output from invoking hostfxr: It was not possible to find any compatible framework version. The specified framework ‘Microsoft.AspNetCore.App’, version ‘{VERSION}-preview-*’ was not found. Failed to start application ‘/LM/W3SVC/1416782824/ROOT’, ErrorCode ‘0x8000ffff’.

  • ASP.NET Core Module stdout Log: It was not possible to find any compatible framework version. The specified framework ‘Microsoft.AspNetCore.App’, version ‘{VERSION}-preview-*’ was not found.

  • ASP.NET Core Module Debug Log: Invoking hostfxr to find the inprocess request handler failed without finding any native dependencies. This most likely means the app is misconfigured, please check the versions of Microsoft.NetCore.App and Microsoft.AspNetCore.App that are targeted by the application and are installed on the machine. Failed HRESULT returned: 0x8000ffff. Could not find inprocess request handler. It was not possible to find any compatible framework version. The specified framework ‘Microsoft.AspNetCore.App’, version ‘{VERSION}-preview-*’ was not found.

Troubleshooting:

  • If running the app on a preview runtime, install either the 32-bit (x86) or 64-bit (x64) site extension that matches the bitness of the app and the app’s runtime version. Don’t install both extensions or multiple runtime versions of the extension.

    • ASP.NET Core {RUNTIME VERSION} (x86) Runtime
    • ASP.NET Core {RUNTIME VERSION} (x64) Runtime

    Restart the app. Wait several seconds for the app to restart.

  • If running the app on a preview runtime and both the 32-bit (x86) and 64-bit (x64) site extensions are installed, uninstall the site extension that doesn’t match the bitness of the app. After removing the site extension, restart the app. Wait several seconds for the app to restart.

  • If running the app on a preview runtime and the site extension’s bitness matches that of the app, confirm that the preview site extension’s runtime version matches the app’s runtime version.

  • Confirm that the app’s Platform in Application Settings matches the bitness of the app.

For more information, see xref:host-and-deploy/azure-apps/index#install-the-preview-site-extension.

An x86 app is deployed but the app pool isn’t enabled for 32-bit apps

  • Browser: HTTP Error 500.30 — ANCM In-Process Start Failure

  • Application Log: Application ‘/LM/W3SVC/5/ROOT’ with physical root ‘{PATH}’ hit unexpected managed exception, exception code = ‘0xe0434352’. Please check the stderr logs for more information. Application ‘/LM/W3SVC/5/ROOT’ with physical root ‘{PATH}’ failed to load clr and managed application. CLR worker thread exited prematurely

  • ASP.NET Core Module stdout Log: The log file is created but empty.

  • ASP.NET Core Module Debug Log: Failed HRESULT returned: 0x8007023e

This scenario is trapped by the SDK when publishing a self-contained app. The SDK produces an error if the RID doesn’t match the platform target (for example, win10-x64 RID with <PlatformTarget>x86</PlatformTarget> in the project file).

Troubleshooting:

For an x86 framework-dependent deployment (<PlatformTarget>x86</PlatformTarget>), enable the IIS app pool for 32-bit apps. In IIS Manager, open the app pool’s Advanced Settings and set Enable 32-Bit Applications to True.

Platform conflicts with RID

  • Browser: HTTP Error 502.5 — Process Failure

  • Application Log: Application ‘MACHINE/WEBROOT/APPHOST/{ASSEMBLY}’ with physical root ‘C:{PATH}’ failed to start process with commandline ‘»C:{PATH}{ASSEMBLY}.{exe|dll}» ‘, ErrorCode = ‘0x80004005 : ff.

  • ASP.NET Core Module stdout Log: Unhandled Exception: System.BadImageFormatException: Could not load file or assembly ‘{ASSEMBLY}.dll’. An attempt was made to load a program with an incorrect format.

Troubleshooting:

  • Confirm that the app runs locally on Kestrel. A process failure might be the result of a problem within the app. For more information, see xref:test/troubleshoot-azure-iis.

  • If this exception occurs for an Azure Apps deployment when upgrading an app and deploying newer assemblies, manually delete all files from the prior deployment. Lingering incompatible assemblies can result in a System.BadImageFormatException exception when deploying an upgraded app.

URI endpoint wrong or stopped website

  • Browser: ERR_CONNECTION_REFUSED —OR— Unable to connect

  • Application Log: No entry

  • ASP.NET Core Module stdout Log: The log file isn’t created.

  • ASP.NET Core Module Debug Log: The log file isn’t created.

Troubleshooting:

  • Confirm the correct URI endpoint for the app is in use. Check the bindings.

  • Confirm that the IIS website isn’t in the Stopped state.

CoreWebEngine or W3SVC server features disabled

OS Exception: The IIS 7.0 CoreWebEngine and W3SVC features must be installed to use the ASP.NET Core Module.

Troubleshooting:

Confirm that the proper role and features are enabled. See IIS Configuration.

Incorrect website physical path or app missing

  • Browser: 403 Forbidden — Access is denied —OR— 403.14 Forbidden — The Web server is configured to not list the contents of this directory.

  • Application Log: No entry

  • ASP.NET Core Module stdout Log: The log file isn’t created.

  • ASP.NET Core Module Debug Log: The log file isn’t created.

Troubleshooting:

Check the IIS website Basic Settings and the physical app folder. Confirm that the app is in the folder at the IIS website Physical path.

Incorrect role, ASP.NET Core Module not installed, or incorrect permissions

  • Browser: 500.19 Internal Server Error — The requested page cannot be accessed because the related configuration data for the page is invalid. —OR— This page can’t be displayed

  • Application Log: No entry

  • ASP.NET Core Module stdout Log: The log file isn’t created.

  • ASP.NET Core Module Debug Log: The log file isn’t created.

Troubleshooting:

  • Confirm that the proper role is enabled. See IIS Configuration.

  • Open Programs & Features or Apps & features and confirm that Windows Server Hosting is installed. If Windows Server Hosting isn’t present in the list of installed programs, download and install the .NET Core Hosting Bundle.

    Current .NET Core Hosting Bundle installer (direct download)

    For more information, see Install the .NET Core Hosting Bundle.

  • Make sure that the Application Pool > Process Model > Identity is set to ApplicationPoolIdentity or the custom identity has the correct permissions to access the app’s deployment folder.

  • If you uninstalled the ASP.NET Core Hosting Bundle and installed an earlier version of the hosting bundle, the applicationHost.config file doesn’t include a section for the ASP.NET Core Module. Open applicationHost.config at %windir%/System32/inetsrv/config and find the <configuration><configSections><sectionGroup name="system.webServer"> section group. If the section for the ASP.NET Core Module is missing from the section group, add the section element:

    <section name="aspNetCore" overrideModeDefault="Allow" />

    Alternatively, install the latest version of the ASP.NET Core Hosting Bundle. The latest version is backwards-compatible with supported ASP.NET Core apps.

Incorrect processPath, missing PATH variable, Hosting Bundle not installed, system/IIS not restarted, VC++ Redistributable not installed, or dotnet.exe access violation

  • Browser: HTTP Error 500.0 — ANCM In-Process Handler Load Failure

  • Application Log: Application ‘MACHINE/WEBROOT/APPHOST/{ASSEMBLY}’ with physical root ‘C:{PATH}’ failed to start process with commandline ‘»{…}» ‘, ErrorCode = ‘0x80070002 : 0. Application ‘{PATH}’ wasn’t able to start. Executable was not found at ‘{PATH}’. Failed to start application ‘/LM/W3SVC/2/ROOT’, ErrorCode ‘0x8007023e’.

  • ASP.NET Core Module stdout Log: The log file isn’t created.

  • ASP.NET Core Module Debug Log: Event Log: ‘Application ‘{PATH}’ wasn’t able to start. Executable was not found at ‘{PATH}’. Failed HRESULT returned: 0x8007023e

Troubleshooting:

  • Confirm that the app runs locally on Kestrel. A process failure might be the result of a problem within the app. For more information, see xref:test/troubleshoot-azure-iis.

  • Check the processPath attribute on the <aspNetCore> element in web.config to confirm that it’s dotnet for a framework-dependent deployment (FDD) or .{ASSEMBLY}.exe for a self-contained deployment (SCD).

  • For an FDD, dotnet.exe might not be accessible via the PATH settings. Confirm that C:Program Filesdotnet exists in the System PATH settings.

  • For an FDD, dotnet.exe might not be accessible for the user identity of the app pool. Confirm that the app pool user identity has access to the C:Program Filesdotnet directory. Confirm that there are no deny rules configured for the app pool user identity on the C:Program Filesdotnet and app directories.

  • An FDD may have been deployed and .NET Core installed without restarting IIS. Either restart the server or restart IIS by executing net stop was /y followed by net start w3svc from a command prompt.

  • An FDD may have been deployed without installing the .NET Core runtime on the hosting system. If the .NET Core runtime hasn’t been installed, run the .NET Core Hosting Bundle installer on the system.

    Current .NET Core Hosting Bundle installer (direct download)

    For more information, see Install the .NET Core Hosting Bundle.

    If a specific runtime is required, download the runtime from the .NET Downloads page and install it on the system. Complete the installation by restarting the system or restarting IIS by executing net stop was /y followed by net start w3svc from a command prompt.

Incorrect arguments of <aspNetCore> element

  • Browser: HTTP Error 500.0 — ANCM In-Process Handler Load Failure

  • Application Log: Invoking hostfxr to find the inprocess request handler failed without finding any native dependencies. This most likely means the app is misconfigured, please check the versions of Microsoft.NetCore.App and Microsoft.AspNetCore.App that are targeted by the application and are installed on the machine. Could not find inprocess request handler. Captured output from invoking hostfxr: Did you mean to run dotnet SDK commands? Please install dotnet SDK from: https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409 Failed to start application ‘/LM/W3SVC/3/ROOT’, ErrorCode ‘0x8000ffff’.

  • ASP.NET Core Module stdout Log: Did you mean to run dotnet SDK commands? Please install dotnet SDK from: https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409

  • ASP.NET Core Module Debug Log: Invoking hostfxr to find the inprocess request handler failed without finding any native dependencies. This most likely means the app is misconfigured, please check the versions of Microsoft.NetCore.App and Microsoft.AspNetCore.App that are targeted by the application and are installed on the machine. Failed HRESULT returned: 0x8000ffff Could not find inprocess request handler. Captured output from invoking hostfxr: Did you mean to run dotnet SDK commands? Please install dotnet SDK from: https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409 Failed HRESULT returned: 0x8000ffff

Troubleshooting:

  • Confirm that the app runs locally on Kestrel. A process failure might be the result of a problem within the app. For more information, see xref:test/troubleshoot-azure-iis.

  • Examine the arguments attribute on the <aspNetCore> element in web.config to confirm that it’s either (a) .{ASSEMBLY}.dll for a framework-dependent deployment (FDD); or (b) not present, an empty string (arguments=""), or a list of the app’s arguments (arguments="{ARGUMENT_1}, {ARGUMENT_2}, ... {ARGUMENT_X}") for a self-contained deployment (SCD).

Missing .NET Core shared framework

  • Browser: HTTP Error 500.0 — ANCM In-Process Handler Load Failure

  • Application Log: Invoking hostfxr to find the inprocess request handler failed without finding any native dependencies. This most likely means the app is misconfigured, please check the versions of Microsoft.NetCore.App and Microsoft.AspNetCore.App that are targeted by the application and are installed on the machine. Could not find inprocess request handler. Captured output from invoking hostfxr: It was not possible to find any compatible framework version. The specified framework ‘Microsoft.AspNetCore.App’, version ‘{VERSION}’ was not found.

Failed to start application ‘/LM/W3SVC/5/ROOT’, ErrorCode ‘0x8000ffff’.

  • ASP.NET Core Module stdout Log: It was not possible to find any compatible framework version. The specified framework ‘Microsoft.AspNetCore.App’, version ‘{VERSION}’ was not found.

  • ASP.NET Core Module Debug Log: Failed HRESULT returned: 0x8000ffff

Troubleshooting:

For a framework-dependent deployment (FDD), confirm that the correct runtime installed on the system.

Stopped Application Pool

  • Browser: 503 Service Unavailable

  • Application Log: No entry

  • ASP.NET Core Module stdout Log: The log file isn’t created.

  • ASP.NET Core Module Debug Log: The log file isn’t created.

Troubleshooting:

Confirm that the Application Pool isn’t in the Stopped state.

Sub-application includes a <handlers> section

  • Browser: HTTP Error 500.19 — Internal Server Error

  • Application Log: No entry

  • ASP.NET Core Module stdout Log: The root app’s log file is created and shows normal operation. The sub-app’s log file isn’t created.

  • ASP.NET Core Module Debug Log: The root app’s log file is created and shows normal operation. The sub-app’s log file isn’t created.

Troubleshooting:

Confirm that the sub-app’s web.config file doesn’t include a <handlers> section or that the sub-app doesn’t inherit the parent app’s handlers.

The parent app’s <system.webServer> section of web.config is placed inside of a <location> element. The xref:System.Configuration.SectionInformation.InheritInChildApplications* property is set to false to indicate that the settings specified within the <location> element aren’t inherited by apps that reside in a subdirectory of the parent app. For more information, see xref:host-and-deploy/aspnet-core-module.

stdout log path incorrect

  • Browser: The app responds normally.

  • Application Log: Could not start stdout redirection in C:Program FilesIISAsp.Net Core ModuleV2aspnetcorev2.dll. Exception message: HRESULT 0x80070005 returned at {PATH}aspnetcoremodulev2commonlibfileoutputmanager.cpp:84. Could not stop stdout redirection in C:Program FilesIISAsp.Net Core ModuleV2aspnetcorev2.dll. Exception message: HRESULT 0x80070002 returned at {PATH}. Could not start stdout redirection in {PATH}aspnetcorev2_inprocess.dll.

  • ASP.NET Core Module stdout Log: The log file isn’t created.

  • ASP.NET Core Module debug Log: Could not start stdout redirection in C:Program FilesIISAsp.Net Core ModuleV2aspnetcorev2.dll. Exception message: HRESULT 0x80070005 returned at {PATH}aspnetcoremodulev2commonlibfileoutputmanager.cpp:84. Could not stop stdout redirection in C:Program FilesIISAsp.Net Core ModuleV2aspnetcorev2.dll. Exception message: HRESULT 0x80070002 returned at {PATH}. Could not start stdout redirection in {PATH}aspnetcorev2_inprocess.dll.

Troubleshooting:

  • The stdoutLogFile path specified in the <aspNetCore> element of web.config doesn’t exist. For more information, see ASP.NET Core Module: Log creation and redirection.

  • The app pool user doesn’t have write access to the stdout log path.

Application configuration general issue

  • Browser: HTTP Error 500.0 — ANCM In-Process Handler Load Failure —OR— HTTP Error 500.30 — ANCM In-Process Start Failure

  • Application Log: Variable

  • ASP.NET Core Module stdout Log: The log file is created but empty or created with normal entries until the point of the app failing.

  • ASP.NET Core Module Debug Log: Variable

Troubleshooting:

The process failed to start, most likely due to an app configuration or programming issue.

For more information, see the following topics:

  • xref:test/troubleshoot-azure-iis
  • xref:test/troubleshoot

:::moniker-end

:::moniker range=»< aspnetcore-2.2″

This topic describes common errors and provides troubleshooting advice for specific errors when hosting ASP.NET Core apps on Azure Apps Service and IIS.

For general troubleshooting guidance, see xref:test/troubleshoot-azure-iis.

Collect the following information:

  • Browser behavior (status code and error message)
  • Application Event Log entries
    • Azure App Service: See xref:test/troubleshoot-azure-iis.
    • IIS
      1. Select Start on the Windows menu, type Event Viewer, and press Enter.
      2. After the Event Viewer opens, expand Windows Logs > Application in the sidebar.
  • ASP.NET Core Module stdout and debug log entries
    • Azure App Service: See xref:test/troubleshoot-azure-iis.
    • IIS: Follow the instructions in the Log creation and redirection and Enhanced diagnostic logs sections of the ASP.NET Core Module topic.

Compare error information to the following common errors. If a match is found, follow the troubleshooting advice.

The list of errors in this topic isn’t exhaustive. If you encounter an error not listed here, open a new issue using the Content feedback button at the bottom of this topic with detailed instructions on how to reproduce the error.

[!INCLUDEAzure App Service Preview Notice]

OS upgrade removed the 32-bit ASP.NET Core Module

Application Log: The Module DLL C:WINDOWSsystem32inetsrvaspnetcore.dll failed to load. The data is the error.

Troubleshooting:

Non-OS files in the C:WindowsSysWOW64inetsrv directory aren’t preserved during an OS upgrade. If the ASP.NET Core Module is installed prior to an OS upgrade and then any app pool is run in 32-bit mode after an OS upgrade, this issue is encountered. After an OS upgrade, repair the ASP.NET Core Module. See Install the .NET Core Hosting bundle. Select Repair when the installer is run.

Missing site extension, 32-bit (x86) and 64-bit (x64) site extensions installed, or wrong process bitness set

Applies to apps hosted by Azure App Services.

  • Browser: HTTP Error 500.0 — ANCM In-Process Handler Load Failure

  • Application Log: Invoking hostfxr to find the inprocess request handler failed without finding any native dependencies. Could not find inprocess request handler. Captured output from invoking hostfxr: It was not possible to find any compatible framework version. The specified framework ‘Microsoft.AspNetCore.App’, version ‘{VERSION}-preview-*’ was not found. Failed to start application ‘/LM/W3SVC/1416782824/ROOT’, ErrorCode ‘0x8000ffff’.

  • ASP.NET Core Module stdout Log: It was not possible to find any compatible framework version. The specified framework ‘Microsoft.AspNetCore.App’, version ‘{VERSION}-preview-*’ was not found.

Troubleshooting:

  • If running the app on a preview runtime, install either the 32-bit (x86) or 64-bit (x64) site extension that matches the bitness of the app and the app’s runtime version. Don’t install both extensions or multiple runtime versions of the extension.

    • ASP.NET Core {RUNTIME VERSION} (x86) Runtime
    • ASP.NET Core {RUNTIME VERSION} (x64) Runtime

    Restart the app. Wait several seconds for the app to restart.

  • If running the app on a preview runtime and both the 32-bit (x86) and 64-bit (x64) site extensions are installed, uninstall the site extension that doesn’t match the bitness of the app. After removing the site extension, restart the app. Wait several seconds for the app to restart.

  • If running the app on a preview runtime and the site extension’s bitness matches that of the app, confirm that the preview site extension’s runtime version matches the app’s runtime version.

  • Confirm that the app’s Platform in Application Settings matches the bitness of the app.

For more information, see xref:host-and-deploy/azure-apps/index#install-the-preview-site-extension.

An x86 app is deployed but the app pool isn’t enabled for 32-bit apps

  • Browser: HTTP Error 500.30 — ANCM In-Process Start Failure

  • Application Log: Application ‘/LM/W3SVC/5/ROOT’ with physical root ‘{PATH}’ hit unexpected managed exception, exception code = ‘0xe0434352’. Please check the stderr logs for more information. Application ‘/LM/W3SVC/5/ROOT’ with physical root ‘{PATH}’ failed to load clr and managed application. CLR worker thread exited prematurely

  • ASP.NET Core Module stdout Log: The log file is created but empty.

This scenario is trapped by the SDK when publishing a self-contained app. The SDK produces an error if the RID doesn’t match the platform target (for example, win10-x64 RID with <PlatformTarget>x86</PlatformTarget> in the project file).

Troubleshooting:

For an x86 framework-dependent deployment (<PlatformTarget>x86</PlatformTarget>), enable the IIS app pool for 32-bit apps. In IIS Manager, open the app pool’s Advanced Settings and set Enable 32-Bit Applications to True.

Platform conflicts with RID

  • Browser: HTTP Error 502.5 — Process Failure

  • Application Log: Application ‘MACHINE/WEBROOT/APPHOST/{ASSEMBLY}’ with physical root ‘C:{PATH}’ failed to start process with commandline ‘»C:{PATH}{ASSEMBLY}.{exe|dll}» ‘, ErrorCode = ‘0x80004005 : ff.

  • ASP.NET Core Module stdout Log: Unhandled Exception: System.BadImageFormatException: Could not load file or assembly ‘{ASSEMBLY}.dll’. An attempt was made to load a program with an incorrect format.

Troubleshooting:

  • Confirm that the app runs locally on Kestrel. A process failure might be the result of a problem within the app. For more information, see xref:test/troubleshoot-azure-iis.

  • If this exception occurs for an Azure Apps deployment when upgrading an app and deploying newer assemblies, manually delete all files from the prior deployment. Lingering incompatible assemblies can result in a System.BadImageFormatException exception when deploying an upgraded app.

URI endpoint wrong or stopped website

  • Browser: ERR_CONNECTION_REFUSED —OR— Unable to connect

  • Application Log: No entry

  • ASP.NET Core Module stdout Log: The log file isn’t created.

Troubleshooting:

  • Confirm the correct URI endpoint for the app is in use. Check the bindings.

  • Confirm that the IIS website isn’t in the Stopped state.

CoreWebEngine or W3SVC server features disabled

OS Exception: The IIS 7.0 CoreWebEngine and W3SVC features must be installed to use the ASP.NET Core Module.

Troubleshooting:

Confirm that the proper role and features are enabled. See IIS Configuration.

Incorrect website physical path or app missing

  • Browser: 403 Forbidden — Access is denied —OR— 403.14 Forbidden — The Web server is configured to not list the contents of this directory.

  • Application Log: No entry

  • ASP.NET Core Module stdout Log: The log file isn’t created.

Troubleshooting:

Check the IIS website Basic Settings and the physical app folder. Confirm that the app is in the folder at the IIS website Physical path.

Incorrect role, ASP.NET Core Module not installed, or incorrect permissions

  • Browser: 500.19 Internal Server Error — The requested page cannot be accessed because the related configuration data for the page is invalid. —OR— This page can’t be displayed

  • Application Log: No entry

  • ASP.NET Core Module stdout Log: The log file isn’t created.

Troubleshooting:

  • Confirm that the proper role is enabled. See IIS Configuration.

  • Open Programs & Features or Apps & features and confirm that Windows Server Hosting is installed. If Windows Server Hosting isn’t present in the list of installed programs, download and install the .NET Core Hosting Bundle.

    Current .NET Core Hosting Bundle installer (direct download)

    For more information, see Install the .NET Core Hosting Bundle.

  • Make sure that the Application Pool > Process Model > Identity is set to ApplicationPoolIdentity or the custom identity has the correct permissions to access the app’s deployment folder.

  • If you uninstalled the ASP.NET Core Hosting Bundle and installed an earlier version of the hosting bundle, the applicationHost.config file doesn’t include a section for the ASP.NET Core Module. Open applicationHost.config at %windir%/System32/inetsrv/config and find the <configuration><configSections><sectionGroup name="system.webServer"> section group. If the section for the ASP.NET Core Module is missing from the section group, add the section element:

    <section name="aspNetCore" overrideModeDefault="Allow" />

    Alternatively, install the latest version of the ASP.NET Core Hosting Bundle. The latest version is backwards-compatible with supported ASP.NET Core apps.

Incorrect processPath, missing PATH variable, Hosting Bundle not installed, system/IIS not restarted, VC++ Redistributable not installed, or dotnet.exe access violation

  • Browser: HTTP Error 502.5 — Process Failure

  • Application Log: Application ‘MACHINE/WEBROOT/APPHOST/{ASSEMBLY}’ with physical root ‘C:{PATH}’ failed to start process with commandline ‘»{…}» ‘, ErrorCode = ‘0x80070002 : 0.

  • ASP.NET Core Module stdout Log: The log file is created but empty.

Troubleshooting:

  • Confirm that the app runs locally on Kestrel. A process failure might be the result of a problem within the app. For more information, see xref:test/troubleshoot-azure-iis.

  • Check the processPath attribute on the <aspNetCore> element in web.config to confirm that it’s dotnet for a framework-dependent deployment (FDD) or .{ASSEMBLY}.exe for a self-contained deployment (SCD).

  • For an FDD, dotnet.exe might not be accessible via the PATH settings. Confirm that C:Program Filesdotnet exists in the System PATH settings.

  • For an FDD, dotnet.exe might not be accessible for the user identity of the app pool. Confirm that the app pool user identity has access to the C:Program Filesdotnet directory. Confirm that there are no deny rules configured for the app pool user identity on the C:Program Filesdotnet and app directories.

  • An FDD may have been deployed and .NET Core installed without restarting IIS. Either restart the server or restart IIS by executing net stop was /y followed by net start w3svc from a command prompt.

  • An FDD may have been deployed without installing the .NET Core runtime on the hosting system. If the .NET Core runtime hasn’t been installed, run the .NET Core Hosting Bundle installer on the system.

    Current .NET Core Hosting Bundle installer (direct download)

    For more information, see Install the .NET Core Hosting Bundle.

    If a specific runtime is required, download the runtime from the .NET Downloads page and install it on the system. Complete the installation by restarting the system or restarting IIS by executing net stop was /y followed by net start w3svc from a command prompt.

Incorrect arguments of <aspNetCore> element

  • Browser: HTTP Error 502.5 — Process Failure

  • Application Log: Application ‘MACHINE/WEBROOT/APPHOST/{ASSEMBLY}’ with physical root ‘C:{PATH}’ failed to start process with commandline ‘»dotnet» .{ASSEMBLY}.dll’, ErrorCode = ‘0x80004005 : 80008081.

  • ASP.NET Core Module stdout Log: The application to execute does not exist: ‘PATH{ASSEMBLY}.dll’

Troubleshooting:

  • Confirm that the app runs locally on Kestrel. A process failure might be the result of a problem within the app. For more information, see xref:test/troubleshoot-azure-iis.

  • Examine the arguments attribute on the <aspNetCore> element in web.config to confirm that it’s either (a) .{ASSEMBLY}.dll for a framework-dependent deployment (FDD); or (b) not present, an empty string (arguments=""), or a list of the app’s arguments (arguments="{ARGUMENT_1}, {ARGUMENT_2}, ... {ARGUMENT_X}") for a self-contained deployment (SCD).

Troubleshooting:

For a framework-dependent deployment (FDD), confirm that the correct runtime installed on the system.

Stopped Application Pool

  • Browser: 503 Service Unavailable

  • Application Log: No entry

  • ASP.NET Core Module stdout Log: The log file isn’t created.

Troubleshooting:

Confirm that the Application Pool isn’t in the Stopped state.

Sub-application includes a <handlers> section

  • Browser: HTTP Error 500.19 — Internal Server Error

  • Application Log: No entry

  • ASP.NET Core Module stdout Log: The root app’s log file is created and shows normal operation. The sub-app’s log file isn’t created.

Troubleshooting:

Confirm that the sub-app’s web.config file doesn’t include a <handlers> section.

stdout log path incorrect

  • Browser: The app responds normally.

  • Application Log: Warning: Could not create stdoutLogFile ?{PATH}path_doesnt_existstdout_{PROCESS ID}_{TIMESTAMP}.log, ErrorCode = -2147024893.

  • ASP.NET Core Module stdout Log: The log file isn’t created.

Troubleshooting:

  • The stdoutLogFile path specified in the <aspNetCore> element of web.config doesn’t exist. For more information, see ASP.NET Core Module: Log creation and redirection.

  • The app pool user doesn’t have write access to the stdout log path.

Application configuration general issue

  • Browser: HTTP Error 502.5 — Process Failure

  • Application Log: Application ‘MACHINE/WEBROOT/APPHOST/{ASSEMBLY}’ with physical root ‘C:{PATH}’ created process with commandline ‘»C:{PATH}{ASSEMBLY}.{exe|dll}» ‘ but either crashed or did not respond or did not listen on the given port ‘{PORT}’, ErrorCode = ‘{ERROR CODE}’

  • ASP.NET Core Module stdout Log: The log file is created but empty.

Troubleshooting:

The process failed to start, most likely due to an app configuration or programming issue.

For more information, see the following topics:

  • xref:test/troubleshoot-azure-iis
  • xref:test/troubleshoot

:::moniker-end

Понравилась статья? Поделить с друзьями:
  • Ошибка 500 apache2
  • Ошибка 500 adobe muse
  • Ошибка 500 102
  • Ошибка 50 средство dism не поддерживает
  • Ошибка 4ло на крузаке моргает