HTTP Error 403.14 - Forbidden. Asp.NET MVC

↘锁芯ラ 提交于 2019-12-12 01:24:26

问题


Am trying to locally host an ASP.NET MVC project on IIS 10 (windows 10 machine). But when I try to access the site I get a "HTTP Error 403.14 - Forbidden" error. The contents of the Web.Config file as well as the error on the loading page are below. Is there something else am missing? Please suggest.

Update: Finally I figured out the issue. This is a webapi project so in the Global.asax.cs I forgot to register the route for the MVC controller which am using.

Thank you for all the suggestions.


回答1:


This check:

  • ~\Views\todoapp
  • ~\Views\todoapp\index.cshtml
  • ~\Controllers\todoappController.cs
  • ~\Controllers\todoappController.cs --> public ActionResult Index() { return View(); }

If the problem can not be found,Check this file:

  • ~\Views\Web.config



回答2:


Just create virtual directory of project and run it on IIS.

  1. Open Visual Studio (Run as administrator).
  2. Select your site under IIS Express Sites.
  3. Right click on Project / Site and click on Properties.
  4. Click on Website menu and New Virtual Directory.
  5. Give Alias Name and Folder path.
  6. Save The Setting and click ok.

Now run same as given alias name and path

Like, http://localhost/ProjectName/Home/Index



来源:https://stackoverflow.com/questions/41791978/http-error-403-14-forbidden-asp-net-mvc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!