Machine: Windows Server 2012 R2 with IIS 8.5 on a company network.
Following this tutorial
- Success: In IIS, deployed a published folder of an
ASP.NET MVC Core 1.1.1
app to an Application Folder underDefault Website
. From a desktop on the same network, browsed to the URLhttp://IP Address/MyPublishedFolder
. The app successfully displayed its home page. - Failure: Created a custom website on the same IIS with one of the DNS Names at the company:
Ourapps.ac.CompanyName.com
with host folder named asOurapps.ac.CompanyName.com
. Copied the exact same published folderMyPublishedFolder
toOurapps.ac.CompanyName.com
. From a desktop on the same network, browsed to the URL:http://Ourapps.ac.CompanyName.com/MyPublishedFolder
. Got the browser error:HTTP Error 502.5 - Process Failure
. In the Event Viewer, the Application Log shows the following error:Application 'MACHINE/WEBROOT/APPHOST/Ourapps.ac.CompanyName.com' with physical root 'C:\Ourapps.ac.CompanyName.com\' failed to start process with commandline '"" ', ErrorCode = '0x80070057 : 0.
Question: Why the same app is working under Default Website
but not under custom website - and how can we resolve the issue?
Note:
http://Ourapps.ac.CompanyName.com/MyPublishedFolder
works fine if I replaced all content ofMyPublishedFolder
with a simple Index.html file created on a notepad. So the issue does seem to be related to ASP.NET Core's published folder deployed to a custom websiteBoth the apps on the above examples are running with a
No Managed Code
Application Pool.
UPDATE:
- Please note the same ASP.NET Core website works fine under Default Website on the same server. That means the sever has all the necessary configurations (hosting bundle DotNetCore.1.0.5_1.1.2-WindowsHosting installed etc.) for an ASP.NET Core 1.1.1 to run on IIS.
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=".\MyCoreWebApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
</system.webServer>
</configuration>
<!--ProjectGuid: 9e4933bc-a6d0-4aa8-b34c-c6db94ed0742-->