Publishing Aspnet Core project to IIS - iis

I have successfully generated a publish folder via following command;
dotnet publish -c Release -r win10-x64 --self-contained
Here is the generated exe file in publish folder.
If I run the exe file, the website runs with no problem on localhost:5000.
However; when I try to put this website on iis, I have the following error;
HTTP Error 500.19 - Internal Server Error
,
Error Code 0x8007000d
Here is my web config file;
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\AURORA.MvcWebUI.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
<!--ProjectGuid: 1E855145-26EA-4E34-8527-9A44CCB14290-->
Could you help me please?

Related

blazor server app 404 on publish at / on 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

Configure the IIS server to run the python application in VPS

I have purchased one windows VPS and I have installed Python using RD. I have configured IIS and fast CGI and I have tried to run the python application using IIS server but it's showing the bellow error,
HTTP Error 500.0 - Internal Server Error
<handler> scriptProcessor could not be found in <fastCGI> application configuration
My web.config file looks like below ,
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="PythonHandler" path="*" verb="*" modules="FastCgiModule"
scriptProcessor="C:\Users\Administrator\AppData\Local\Programs\Python\Python310\python.exe|C:\Users\Administrator\AppData\Local\Programs\Python\Python310\Lib\site-packages\wfastcgi.py"
resourceType="Unspecified" requireAccess="Script"/>
</handlers>
</system.webServer>
<appSettings>
<add key="PYTHONPATH" value="C:\LMX"/>
<!-- The handler here is specific to Bottle; see the next section. -->
<add key="WSGI_HANDLER" value="app.wsgi_app()"/>
<add key="WSGI_LOG" value="C:\LMX\wfastcgi.log"/>
</appSettings>
</configuration>
Could you please solve the issue

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.

Edit Web.config file

I have the following webconfig file produced by visual studio 2017 on a .net core application
<?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=".\SportsStore.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
<!--ProjectGuid: 5795049b-4d7e-4559-9010-f9134df11849-->
Although the publish succeed I get the following on the web page
Detailed Error Information:
Module
IIS Web Core
Notification
BeginRequest
Handler
Not yet determined
Error Code
0x8007000d
Config Error
Config File
\\?\C:\inetpub\wwwroot\sportstore\web.config
Requested URL
http://localhost:80/sportstore
Physical Path
C:\inetpub\wwwroot\sportstore
Logon Method
Not yet determined
Logon User
Not yet determined
Config Source:
-1:
0:
Because I have already work only on apache and the build in IIS express of visual studio I do not know where to start from. Internet has plethora of info and I tried many things but nothing.
Any suggestion?

Resources