dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.45k stars 25.33k forks source link

ASP.NET Core 6.0 Documentation For IIS Out Of Date. #23934

Open alexhiggins732 opened 2 years ago

alexhiggins732 commented 2 years ago

Documentation for running .NET 6 on IIS is incomplete and out of date.

  1. The documentation to install the hosting bundle points to the .NET 5 hosting bundle. Example: For example: https://docs.microsoft.com/en-us/aspnet/core/tutorials/publish-to-iis?view=aspnetcore-6.0&tabs=visual-studio
  2. None of the documentation mentions web.config or how to wire up IIS to server the .NET Core module.
  3. Separately finding the web.config documentation and using the configurations shown for previous versions of Dot Net Core after installing the correct .NET 6 hosting bundle does not appear to work.

Without a handler, the error HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory. is shown

<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <aspNetCore processPath="dotnet"
                  arguments=".\MyApp.dll"
                  stdoutLogEnabled="false"
                  stdoutLogFile=".\logs\stdout"
                  hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>

With a v2 handler specified the HTTP Error 500.31 - Failed to load ASP.NET Core runtime is shown image

<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>

With a AspNetCoreModule handler specified the HTTP Error 502.5 - Process Failure is shown image

<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*"
        modules="AspNetCoreModule" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet"
                  arguments=".\MyApp.dll"
                  stdoutLogEnabled="false"
                  stdoutLogFile=".\logs\stdout"
                  hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Rick-Anderson commented 2 years ago

@shirhatti can you outline the changes we need to make for to The ASP.NET Core Module for .NET 6?

guardrex commented 2 years ago

@shirhatti @jkotalik ... We're getting a few repeat issues on the hosting bundle permalink pointing to the 5.0 installer.

[Current .NET Core Hosting Bundle installer (direct download)](https://dotnet.microsoft.com/permalink/dotnetcore-current-windows-runtime-bundle-installer)

Side Note: There isn't a 6.0 version (moniker range) for this topic yet, but I believe that just updating the permalink would be a good, quick step to head off these issues coming in.

shirhatti commented 2 years ago

@mairaw Do you own this permalink? And if so, can you help update it?

mairaw commented 2 years ago

I believe so. Let me investigate.

guardrex commented 2 years ago

Cross-linking another IIS-related issue in case all of the IIS updates can be worked together ...

https://github.com/dotnet/AspNetCore.Docs/issues/23975

mairaw commented 2 years ago

I pushed a quick fix this morning to point the link to 6. We'll make a more permanent update in the upcoming days to not have to worry about versions in the future. It should just switch to the latest whenever we have a new release.