ASP.NET Core 3.1 web application throws error 500.30 when run on IIS Express, but not when using dotnet watch run

I had the same problem with IISExpress. The only way I could get ride of the 500.30 error, was to run the application in OutOfProcess mode.


There is github issue about this problem.

Using 2.x versions of Microsoft.Extensions.* and Microsoft.AspNetCore.* packages in an ASP.NET Core 3.0/3.1 project is *not supported.

In my case i was depending on nuget package which was depending on Microsoft.AspNetCore 2.x.x. After removing the nuget the project ran without issues under IIS Express.

If anyone is still having this issue, you can try to remove dependencies with version 2.x because they are automatically resolved from the SDK.