question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AspNetCoreModuleV2 and hostingModel="InProcess" in IIS sub application failing to start

See original GitHub issue

IIS configuration is:

Root SPA static file application -> /api folder is an application in IIS

root app web config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
		<defaultDocument>
            <files>
                <clear/>
                <add value="index.html"/>
            </files>
        </defaultDocument>
		<httpErrors errorMode="Custom" existingResponse="Replace">
			<clear />
            <remove statusCode="404" subStatusCode="-1" />
            <error statusCode="404" prefixLanguageFilePath="" path="index.html" responseMode="File" />
        </httpErrors>
    </system.webServer>
</configuration>

sub app (api) web config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\eG_Control_Api.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
    <httpErrors errorMode="Detailed" />
  </system.webServer>
</configuration>

yields api responses of HTTP Error 500.30 - Internal Server Error. changing the process model allows it to work.

event viewer shows messages along the lines of ... application ... hit unexpected managed exception, exception code = '0xe0434352'. Please check the stderr logs for more information.. Enabling stderr logs yields 0 byte files.

dotnet --info:

.NET Core SDK (reflecting any global.json):
 Version:   2.2.101
 Commit:    236713b0b7

Runtime Environment:
 OS Name:     Windows
 OS Version:  6.3.9600
 OS Platform: Windows
 RID:         win81-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.2.101\

Host (useful for support):
  Version: 2.2.0
  Commit:  1249f08fed

.NET Core SDKs installed:
  2.0.0 [C:\Program Files\dotnet\sdk]
  2.2.101 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 1.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

i’ve been trying to find documentation that notes that sub applications do not function with the in process model but have been unable. the only limitation note i’ve found is that app pools are limited to a single application, to which i did separate the two apps to their own pools.

please let me know if there is any other information i can provide.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
jkotalikcommented, Dec 17, 2018

The error code you are getting means the app has reached Program.Main, but your application is throwing an exception. This doesn’t look like an issue with subapplications. Can you try adding the following to your application:

try 
{
    // Program.Main logic
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message);
}

The most common issue people have been running into is the CurrentDirectory() being set to C:\Windows\System32\inetsrv rather than the app directory. Our current recommendation is to use https://github.com/aspnet/Docs/blob/master/aspnetcore/host-and-deploy/aspnet-core-module/samples_snapshot/2.x/CurrentDirectoryHelpers.cs to work around this until a future patch release.

1reaction
mikola-akbalcommented, Mar 16, 2019

I removed all from “secrets.json” and received the same problem. This JSON must have at least { } inside.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ASP.NET Core IIS InProcess Hosting Issue in .NET Core 3.1
NET Core CLR in-process, but it fails to start. The cause of a process startup failure can usually be determined from entries in...
Read more >
In-Process Hosting Model - Error 500.30 #7025
Has somebody tried using InProcess hosting model? ... and hostingModel="InProcess" in IIS sub application failing to start.
Read more >
Troubleshoot ASP.NET Core on Azure App Service and IIS
The cause of a process startup failure can usually be determined from entries in the Application Event Log and the ASP.NET Core Module...
Read more >
IIS: Handler "aspNetCore" has a bad module ...
Open IIS Manager, go to Modules. If AspNetCoreModuleV2 is not listed, click "Configure Native Modules..." and select "AspNetCoreModuleV2" and ...
Read more >
Four reasons why your ASP.NET Core application is not ...
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....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found