1

I have developed a Blazor WebAssembly App that will be used on a Server running Windows 2012 on our Intranet. This is targeting .Net 5.0 Core Hosted and Self-Contained. I need to deploy to IIS 8.5 and have some questions.

When I add the website in IIS, do I point to the root deploy directory with the executable and web.config? Is there anything else I need to do so that IIS will find the index file in the wwwroot sub-directory? Is is appropriate to put the deploy directory for this app directly under inetpub? The publish task created a rather large BlaorDebugProxy directory. This is for release so I don't understand why this was created. Is there a way to prevent this from happening? I want to access the app using ServerName\AppName. If I create the site with 'AppName' for the host name, will that work or is there something else I need to do? When I try to browse to the site from IIS, I get a 500.19 'The requested page cannot be accessed because the related configuration data for the page is invalid.' I have not made changes to the file as it was created by the publish process. It is:

<?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=".\AppName.Server.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: 60862cf1-bea8-48f4-8ae9-270f2f537927-->

Any ideas why this is not working?

PLEASE NOTE that this is using the SELF-CONTAINED model. Also, I have made sure that the directory has granted full permissions to the App Pool Identity for this App.

The answer below and the supposed duplicate all refer to installing the framework. However, I thought that the whole point of the self-contained model is that it does not rely on an installed framework.

I have searched extensively and see many references that touch on these issues but nothing that says specifically how to get IIS (especially an older version) to host the self-contained model. The Microsoft pages talk about advantages and disadvantages and how to create the files but no details about how to host them or the other questions I listed above.

Has anyone done this successfully who can provide some guidance?

Thanks !

David Bowser
  • 107
  • 2
  • 10

1 Answers1

3

Firstly, please ensure that the Asp.net Core IIS Hosting Bundle installer has been installed on the server.
https://dotnet.microsoft.com/download/dotnet/5.0
enter image description here
Besides, the identity under where your web application runs in IIS should have full access to the root folder of your website. Try to grant the IUSR account full control to that physical path.
Last, please refer to the below link to hosting Core-based web application in IIS.
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.1
Feel free to let me know if the problem still exists.

Abraham Qian
  • 7,117
  • 1
  • 8
  • 22
  • I don't understand why I need to install .Net Hosting Bundle when I am deploying a Self-Contained App. I thought this meant that .Net Core would be contained in my app so I wouldn't need to also install it on the system. – David Bowser Aug 18 '20 at 13:20
  • @DavidBowser .NET Core is contained but IIS knows nothing about it without it, so it doesn't know it needs to integrate your application in its pipeline and forward calls to it – Panagiotis Kanavos Oct 23 '20 at 13:47