1.What I want to do
I am new to C# and now trying to deploy a "ASP.NET web application" to IIS. I tried to follow the steps introduced in this website but instead of the view (Index.cshtml) showing, some directory list shows up when I test “Browse” from IIS.https://www.guru99.com/deploying-website-iis.html
2.Current Problem
It is currently showing some directory list instead of the view (Index.cshtml).3.What I did
STEP1.Create ASP.NET Core Application
-After adding a project, I added a Controller(HomeController) and a View(Index.cshtml)
-After that I was able to access using IIS Express with URL "https://localhost:44320/Home/Index"
STEP1.Create ASP.NET Core Application
STEP1.Success https://localhost:44320/Home/Index
STEP2.Publish
-Give a Target Folder and generate the application
-The destination I gave a path in “C\TempApp” (Sorry, the path in the image is wrong, I actually gave “C\TempApp”)
STEP3.Add new application in IIS
-Give the Pysycal path " C:\TempWeb\Home\View "
-Give the host as “localhost”
STEP3.Add new application in IIS
STEP4.Test
-Right click the new Application -> Manage Application -> Browse
STEP5.Fix Error
Following the message shown in 403 screen, I enable “Directory Browsing” , then I got the following result.
2021/1/27 19:00 add
I got advice to check the default page, and it seems the Default page was auto generated to point the View I created.When I check the "Server Role" setting of IIS, I found ASP.NET and .NET 4.7 is not checked, and estimating that this might be the cause.