Jonathan Wood
Jonathan Wood

Reputation: 67315

Unable to resolve 500.30 error in simple web application

Error

I just created a new Razor Pages website. It's simple and only has a couple of page. But the site is failing with the following message.

enter image description here

Event Viewer

I see the event viewer is reporting errors.

Application '/LM/W3SVC/7/ROOT' with physical root 'C:\inetpub\wwwroot\scwebgroup.com' hit unexpected managed exception, exception code = '0xe0434352'. Please check the stderr logs for more information.

Application '/LM/W3SVC/7/ROOT' with physical root 'C:\inetpub\wwwroot\scwebgroup.com' failed to load coreclr. Exception message: CLR worker thread exited prematurely

Error Logging

I set stdoutLogEnabled to true in web.config.

<?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=".\SCWebGroup.exe" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: 43bcc2f4-878c-4b9a-903b-16d6bf867dc5-->

But I can find no log folder or any log files.

Running from the Command Line

I read you can try running the application from the command line and any errors might be shown, so I tried that. But when I ran the application, no errors were reported. It appeared to run correctly.

enter image description here

Target Version of .NET

My app is targeting .NET 6.0 and I have other applications that target .NET 6.0 on this same server. So I know this version of .NET is installed.

Summary

The application runs fine when I run it within Visual Studio.

The new application does not access any database.

I'm out of ideas. Can anyone offer other things to try here?

Upvotes: 5

Views: 8817

Answers (3)

Iain Carlin
Iain Carlin

Reputation: 590

On experiencing the same issue/error I found the cause to be an environment entry in the web.confg:

          <environmentVariable name="APIDISCOVERY_FILEPATH" value="D:\MyApp\obj\Debug\net6.0\ApiEndpoints.json" />

The project had been upgraded to .net 8.0. Commented out this entry and the application runs fine in IIS again.

Upvotes: 1

Dave Cousineau
Dave Cousineau

Reputation: 13198

One thing to check is the AppPool. When making a new WebSite in IIS7, for example, it will default to a new v2 AppPool. Select probably your DefaultAppPool instead (v4).

Upvotes: 0

JuanR
JuanR

Reputation: 7803

When deploying, be sure to set the correct Target Runtime. If you are running on Windows Server, this will likely be win-x64.

If you get this wrong, the application will fail to load, and will give errors similar to what you're reporting.

Upvotes: 7

Related Questions