I'm trying to deploy new asp.net core 5 (5.0.100-rc.1.20452.10) app to IIS on Win 10 and Windows Server 2019.

I've deployed the app using Visual Studio to Default Web Site with ApplicationPoolIdentity and granted full access permission to both "IIS_IUSRS" and "Everyone".

I'm still getting:

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

When I try to open the config in IIS Manager I get "Data is invalid" error:

iis manager error

The webconfig looks pretty normal:

<?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=".\MyApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>

I think I've installed all IIS Features:

windows features

1

There are 1 answers

0
mohammadAli On

I had the same issue, while deploying net core 6 application.

I gave the IUSR and IIS_IUSR permissions. I installed the URL rewrite extension.

The thing finally saved me was I checked for if net core hosting was installed on my system, we can verify in system registry under:

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Updates.NET Core path like screenshot below. Registry image

And I fixed it after downloading the hosting module: .Net hosting bundle

And now the settings and application works fine.