3

I am following this guide in order to host my Blazor WebAssembly project: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/blazor/webassembly?view=aspnetcore-3.1#rewrite-urls-for-correct-routing

I have installed the URL Rewrite module 2.1 but I still receive this error:

HTTP Error 500.19 - Internal Server Error
Error Code: 0x8007000d
Config File \\?\C:\MyProject\web.config 

I am pointing the Physical path to one step above wwwroot, i.e the root folder of my project after publish.

My web.config in root folder looks like this:

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

What am I missing? I have .NET Core 3.1.202 installed. My project is built upon the default template. Meaning an ASP.NET Core hosted Server part and WebAssembly-powered Client part. I am using port 81 for the IIS site.

Appreciate any guidance

ArturM
  • 171
  • 1
  • 11
  • 1
    Does this answer your question? [How do I configure a .net core API to work in IIS?](https://stackoverflow.com/questions/50612351/how-do-i-configure-a-net-core-api-to-work-in-iis) – Lex Li May 13 '20 at 04:03
  • That solved my problem! Thanks @LexLi – ArturM May 13 '20 at 13:11

2 Answers2

4

Solved by installing the ASP NET Core hosting module: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-3.1

ArturM
  • 171
  • 1
  • 11
  • Updated link for .NET 6 ASP.NET Core hosting bundle: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/ – Paul Schroeder Jul 11 '22 at 03:28
  • Same for me as well. In my case this was needed for a Blazor Web Assembly app that uses static files only. I did find a reference to this requirement in the Microsoft documentation: https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly?view=aspnetcore-7.0#install-the-url-rewrite-module – steve's games Nov 15 '22 at 17:17
3

On IIS 10 I had to install additional module - URL Rewrite: https://www.iis.net/downloads/microsoft/url-rewrite

pawellipowczan
  • 500
  • 5
  • 11