I am fairly new with the .net core framework and I am not very experienced setting up IIS 10 and am having trouble getting this up and running. On the servers end I am running Windows Server 2016. I have installed IIS 10 with Management Services (see image below) and the .net framework 4.6 features (see image below).
After installing this I have downloaded and installed the Web Deploy package from Web Deploy 3.6 (Previously I was installing the Web Platform Installer and then installing Web Deploy from there).
After rebooting the system I've made sure that the services are running properly (see image below).
All seems to be correct so the next step was to create an IIS website I decided to nest the site under the Default Web Sites as seen below:
The site points to the default application pool since I did not create a new one. I modified the app pool to the following settings:
I also changed its Identity to NetworkService previously I tried it set to LocalSystem (See image below).
I also made sure the users IUSR and IIS_IUSRS have read, execute and write permissions to the web site directory and sub directories (See images below).
Once this is all done I install the .net core hosting bundle downloaded from .Net Core Hosting Bundle.
And finally in Visual Studio my project is a .net core 2.1 razor page project. When publishing my project I created a profile to publish it with the following settings:
My connection validated just fine so I hit Next and setup the next step with the following settings:
I save the profile then publish it and it works perfectly. If I check the server the files have all been published and seem to be correct. However if I try navigating to the page http://myserver/BlankLabel/ I get a 404 error (see image below). Now if I try navigating to the Default Web Site (http://myserver) that loads up just fine.
I would appreciate any help with this since I am not to experienced with setting this up and surely enough am missing something...
References
Host ASP.NET Core on Windows with IIS
Publishing and deploying a Razor Pages application to IIS on Windows
Deploying .NET Core apps with Visual Studio
Update #1
I attempted to create a new site under Default Web Sites and just add a plain index.htm page to see if it would load. Once I saw that it was working I published my application into this new site (created a temporary second profile to do this) and tried reloading the page. The outcome of this was that it resulted in the same original error (my index.htm file still remained in the folder along with the published files). I then deleted the published files and reloaded and once again it worked with the index.htm file... Clearly something is going on with the .net core 2.1 project and IIS not liking it...
Update #2
Just thought that I would add that the AspNetCoreModule is loaded and it is also set as the startup (see images below). So i guess it just seconds my previous update...
Update #3
Just adding the web.config file as requested (I also noticed the logs are off i will be setting them to true and see if it gives me any extra info):
<?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=".\BlankLabel.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
I suggest to check your published ASP.NET Core web.config file and enable logging by setting stdoutLogEnabled=true
.