Search code examples
asp.net-mvc-5iis-10.net-4.7

How to set up IIS 10 for MVC 5?


The title is purposely generic as I have no clue to formulate my question in any different way. I have made an MVC 5 project using .NET 4.7. My goal is to use IIS 10 to point to a domain so I can use that as a testing ground. I have already edited my host-file to point my localhost ip to the domain I have in mind. After that I have followed every step mentioned in the video below meticulously. However I keep ending up on the 403.14 error page. I have adjusted security to no avail, checked the app-pool to use the correct .net version... I'm all out off ideas.

https://www.youtube.com/watch?v=IwbKquNBNgQ

I hope someone here has some idea of things I have not thought of myself, so feel free to ask anything you think might make the change I need to make this work. I will edit this message (and title) as much as needed to keep up to date as possible.

EDIT: I have followed the full guide that I have marked as an answer. I had 3 differences. Difference 1 was in Windows Features. I think I just plain didn't correctly mark all the needed features.. Difference 2 was in Security. I did not have IIS_IUSRS added, only IUSR Difference 3 is one I have purposely keep a difference and that is Directory Browsing. Without this being enabled, it works for me.

I hope that if anyone ends up on this page in the future, the answer provided below will be as helpful as it has been to me.


Solution

  • make sure you enabled below iis features:

    enter image description here

    please follow the below steps to publish your MVC project in iis.

    1)open the visual studio. Select your site and right-click on that-> Click publish.

    enter image description here

    2)in pick up publish target Select folder option and create choose destination where you want to publish the site. (make a new folder and publish a site in that folder) and then select publish.

    enter image description here

    3)open IIS manager.

    4)expand the server name and right-click on sites and select add a new site.

    enter image description here

    5)enter the site name, physical path, and site binding details.

    ip address: select your machine ip address. port: 80 domain name: your domain name

    enter image description here

    6)make sure you enabled directory browsing in iis.

    enter image description here

    7) The application pool is running under application pool identity, a version is correct and using the integrated pipeline.

    enter image description here

    8)anonymous authentication is enabled.

    enter image description here

    9)iis_iusrs and iusr have full permission to access the site folder.

    enter image description here

    host file enry:

    enter image description here

    bind your machine IP dress with a hostname of the site.

    after doing all the changes refresh the site in iis and browse.

    enter image description here