How to set up IIS 10 for MVC 5?
Asked Answered
F

1

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.

Festivity answered 25/11, 2019 at 21:6 Comment(8)
403.14 means your ASP.NET MVC routing was not configured properly, so IIS handles the request, instead of ASP.NET runtime. Either you used the wrong URL or your web app was not deployed as an individual IIS application. Tons of similar posts here on Stack Overflow, so you really should search for duplicates first.Untouchable
I have searched high and low on SO for duplicates, found many, read many and tried them. You can read some of those in the last line before the link. Nothing works for some reason. I included the video, because it perfectly summarizes what I've done. If you think a certain duplicate would help, I'd kindly request you to link it, because your comment has not been of any help I'm afraid.Festivity
Asking others to watch a video irrelevant to your actual setup is just a waste of time.Untouchable
How is the video irrelevant? It is showing precisely what I'm trying to achieve. If that wasn't clear from my question, I should adjust it but without proper input, I can't do that. I'm wondering if you even read what I've written at all.Festivity
I mean you should record your actual setup, instead of showing other's video. It works for that guy, but not yours, so what's the problem here?Untouchable
Just to be very clear. I followed every single step to the letter. My setup is exactly the same is the video shows. That's why I'm so damn confused on why it isn't working. I've tried it with brand new projects, new IIS installs, the whole shebang. It is frustrating to no end. Again: I do literally exactly the same thing as shown in the videoFestivity
I believe you have followed that video as much as you could. However, the truth is that even the slightest difference can lead to issues like that. So by refusing to reveal your setup, you effectively rule out the help you might get.Untouchable
I shall edit my post as much as possible when I get the chance. Work obligations will prevent that from happening the next 12 hours or so.Festivity
A
6

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

Absalom answered 26/11, 2019 at 7:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.