I'm setting up a server to host an application I made with ASP.NET Core 2.0.3. I'll be running this application on a Windows Server 2012 R2 server, using IIS 8.5. I followed this Microsoft tutorial to set up the environment.
If I run (dir (Get-Command dotnet).Path.Replace('dotnet.exe', 'shared\Microsoft.NETCore.App')).Name
in PowerShell.
It tells me I'm running the right version of the runtime environment and by running dotnet MyProject.dll
it runs the project on port 5000 and I can access it from the server. But when accessing with the server URL, this is the page I see:
The .NET CLR Version of the application pool is set to No Managed Code and this is my web.config file:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="Redirect to https" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
</rule>
</rules>
</rewrite>
<modules runAllManagedModulesForAllRequests="false">
<remove name="WebDAVModule" />
</modules>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments="C:\inetpub\wwwroot\MyApp.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="3221225472" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
I also tried to remove the rewrite rules and nothing changes. And there is no error log created.
I'm lost on what else I can try. How can I fix it?