receiving error 500.19 when attempting to launch website - iis

We are moving our websites from a 2008 r2 server running IIS 7.5. The first program I moved over was asp.net core when attempting to run it I get the error HTTP Error 500.19 - Internal Server Error with the error code 0x8007000d. This starts my internet search unfortunately I don't have a config error which would narrow down the search quite a bit and none of the solutions I found worked. This code works on the old server just fine and I don't have anything in my code specifying the cpu so it not set to 32 bit.
Everything I have tried points me in the direction that the web.config file cannot be accessed. one of the reasons I say that is when I try to open configuration editor I receive the error the data is invalid (Exception from HRESULT: 0x8007000D) below is the web.config that I am using.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\Brochure_Fulfillment.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: e089189f-00f3-48ee-9532-1c03776dad6a-->

Related

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

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?

HTTP Error 502.5 running ASP.NET Core 2.0 app from IIS

I'm getting an HTTP 502.5 error when trying to run my ASP.NET core 2.0 web app from IIS.
I've installed the .NET Core Windows Server Hosting Bundle and checked all my IIS settings as per this document https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/index?tabs=aspnetcore2x
The web.config looks like this.
<?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=".\OscarWeb.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
The Windows event log produces the following errors.
It is IIS v6.2 running on Windows Server 2012 R2. The web application was built using ASP.NET Core 2.0.
When I run dotnet from the commandline as follows there are no errors:
dotnet oscarweb.dll
The first thing you have to do in this scenario is to create the logs folder if it is missing and check the stdout logs generated.
It can be several different things but from personal experience the most common issue i had was IIS not having enough permissions to run it. In IIS you can configure the Identity used in Advanced Settings. If it is using ApplicationPoolIdentity then change it to LocalSystem and see if it works. The logs in the stdtout file however will give you the answer.
The solution to this problem (in my case at least) was to reboot the web server. After installing the .NET Core Windows Server Hosting Bundle you need to reboot the server for them to be registered correctly.
Thanks to Chris Pratt (first comment underneath my question) for suggesting the answer :)
Not sure if your webconfig is complete. I believe aspnetcore tag needs to have the ASPNETCORE_ENVIRONMENT environment variable set as well.
<?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=".\OscarWeb.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" >
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="YourRuntimeEnv" />
</environmentVariables>
</aspNetCore>
</system.webServer>
</configuration>

Azure multiple sites in virtual directories

I have 3 asp.net core sites I need to deploy on the same domain (subdomains will not work with my SSL certificate).
https://my-site.com (Single page app)
https://my-site.com/api (Web api)
https://my-site.com/identity (Identity server)
When I deploy the api and identity projects, they work fine. However, when deploying the single page app, api and identity stop working.
The page cannot be displayed because an internal server error has occurred.
The error appears instantly so it's probably failing early on from startup I guess.
The single page app is working ok.
It seems the spa is interfering, I tried solutions from here to ignore the routes, but I get the same error.
I have tried the solution here to get a more descriptive error but to no avail.
Not sure where to go from here
The cause of the problem is that both the root application and the child app add the aspNetCore handler, causing the config system to blow up. You can see this by turning on Detailed error messages in the Azure Portal, and then finding the error page under D:\home\LogFiles\DetailedErrors. You'll see this error:
Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'aspNetCore'
There are two approaches to solving this.
The first is to use a location tag to prevent inheritance. Specifically, change your root app's web.config from something like this:
<?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=".\myapp.dll" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout" />
</system.webServer>
</configuration>
to something like this:
<?xml version="1.0" encoding="utf-8"?>
<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="\\?\%home%\LogFiles\stdout" />
</system.webServer>
</location>
</configuration>
The second approach is to remove the <handlers> section from the sub-application to avoid the duplication (as suggested in the doc under Configuration of sub-applications):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<aspNetCore processPath="dotnet" arguments=".\mySubApp.dll" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout" />
</system.webServer>
</configuration>

Resources