0

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.

Web.configlanding page

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. Missing route config

LearnCode
  • 435
  • 7
  • 17
  • check this link http://serverfault.com/questions/405395/unable-to-get-anything-except-403-from-a-net-4-5-website and also this one http://stackoverflow.com/questions/11425574/mvc4-http-error-403-14-forbidden – Nowshad Rahaman Jan 22 '17 at 14:25
  • Please paste the code into the question *as text*, not as an image. –  Jan 22 '17 at 23:23

3 Answers3

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
M.R.T
  • 746
  • 8
  • 20
  • Also, to state the obvious (just incase), also check you are publishing your site into the correct folder that you have setup in IIS for the site. – Si Bxxx Jan 22 '17 at 15:31
1

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

0

Another cause for that is to have define

protected void Application_Start() 

as an Async function.

Badr Bellaj
  • 11,560
  • 2
  • 43
  • 44