blazor server app 404 on publish at / on IIS - iis

I have a blazor app that is running fine on localhost.
Here's the steps I have taken to put my project live.
Setup new Windows Server on AWS.
Enabled IIS.
Installed ASP.NET Core Runtime Hosting Bundle.
Installed the URL Rewrite module.
Setup a SSL cert and DNS settings to point to IP.
Configured bindings to port 443 and picked the cert added path wwwroot/projectname
published my project using web deploy.
However, when navigating to my url I'm seeing 404 resource not found.
Only thing that is different is that the server added a web config to get it to run in IIS which looks like this.
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\App.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 8b081fc5-0f9d-4426-b9cf-90f4d30b5527-->
Anyone point me in the right direction as to what I should be looking out for or steps I may have missed as this is the first time I've attempted publishing a Blazor-Server application.

On my IIS, I have "AspNetCoreModuleV2" not "AspNetCoreModule" like this:
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\App.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 8b081fc5-0f9d-4426-b9cf-90f4d30b5527-->
See: Hosting A Blazor Visual Studio Project Directly In IIS

Related

Why Azure Web App not starting when I add maxAllowedContentLength in web.config?

I'm developing ASP.NET 7 WebApi app which is hosted on Azure Web App. I need to transfer large files. Many resources show that I need to add node in web.config, but when I add, my azure web app won't start.
My web.config
<?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=".\WebApplication1.dll" stdoutLogEnabled="false"
stdoutLogFile="\\?\%home%\LogFiles\stdout" hostingModel="inprocess" />
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483647 " />
</requestFiltering>
</security>
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 46edd0a7-6184-47ed-a0e9-d3be7fee8b41-->
And this message is shown when I try to open web app.
As in title: Why it's not working? Do I missed some step?

Is it possible to have 2 ASP.NET Core sites in one Web App?

Is it possible to have 2 ASP.NET Core Web API apps inside the one App Service?
I understand that it would be better to have the 2 sites in separate App Services, but our use case is a bit unique.
We're trying to add the 2nd site for the purposes of using the applicationInitialization feature to introduce a delay between our app starting and the instance being given to the App Service load balancer.
I could go into a lot more detail on this, but what I desire for now is to bolt-on an additional web site that the applicationInitialization can call to delay the startup process.
I've tried:
Folder structure:
/mySite
/mySite2
web.config
Folder structure:
/mySite2
mySite.dll
web.config
With respective web.Configs looking like:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="mySite" inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\mysite\mySite.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="OutOfProcess" />
</system.webServer>
</location>
<location path="mySite2" inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\mySite2\mySite2.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="OutOfProcess" />
</system.webServer>
</location>
</configuration>
and
<?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=".\mySite.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
</system.webServer>
</location>
<location path="mySite2" inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\mySite2\mySite2.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="OutOfProcess" />
</system.webServer>
</location>
</configuration>
YES. It is possible, you can have two applications on a single web app with a virtual directory.
From docs:
Virtual Directories are supported for Azure Websites. See Configuring
Azure Websites for what you can do through the Azure Management
Portal. From the Azure Portal, click on the Website and go to
Configure, then scroll down to virtual applications and directories
(the last config section). Just enter your virtual directory and the
physical path relative to the site root and click Save.

How can I resolve 500.19 on all my application?

I create .Net Core web application, I have to download .NET Core Runtime & Hosting Bundle but when I do that all my application get this error.
Even if I uninstall it, I still have the error.
When I try to run it in the command prompt with dotnet command it works but it doesn't work on IIS 10.
UPDATE :
web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\ProjectName.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>

Can't publish ASP.NET Core anything to IIS Host

First I will like to disclose that this is my first attempt at publishing a .net core app to a live server. Everything I have done on the past has been on a local Host Server.
The problem I am having is that I can't get any kind of application even the temple created in VS2017 V15.7.2 to return anything other than 500 server error. I can't even get it to produce log files so I can try to figure out what is going on.
Here is my web.config file from the published server.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\BareBones.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
I can connect via FTP and see all of the files but, that is about it. Of course everything works great locally.
Any and all help is greatly appreciated.

Run go web application on IIS

Is there a way to run Go web application on IIS?
I found a setting for azure but its not working on my dev machine
this is a web config for azure :
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="d:\home\site\wwwroot\go\bin\go.exe"
arguments="run d:\home\site\wwwroot\server.go"
startupTimeLimit="60">
<environmentVariables>
<environmentVariable name="GOROOT" value="d:\home\site\wwwroot\go" />
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>
Your local IIS does not work simply because you need to install a separate component, called HttpPlatformHandler module,
https://azure.microsoft.com/en-us/blog/announcing-the-release-of-the-httpplatformhandler-module-for-iis-8/
http://www.iis.net/downloads/microsoft/httpplatformhandler
Reverse proxy or FastCGI were the older approaches which are no longer necessary with this new approach.
HttpPlatformHandler module doesn't work for me. I found this post by Sutean Rutjanalard on Medium very helpful, which use ASP.NET Core Module instead.
Basically, you need to create Application pool with "No Managed Code" as you do with a .net core app. And the following is the web.config.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\YourGoApp.exe" />
</system.webServer>
</configuration>

Resources