Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't run ASP.NET MVC 2 web app on IIS 7.5

I'm trying to run an ASP.NET MVC 2 web application under IIS on Windows 7, but I get a 403.14 error. Here are the steps to reproduce:

  1. Open Visual Studio 2010
  2. Create a new ASP.NET MVC 2 project called MvcApplication1
  3. Shift+F5 to run the app. You should see http://localhost:{random_port}/ and the page will render correctly.
  4. Click on MvcApplication1, and select "Properties". Go to the "Web" section.
  5. Select "Use Local IIS Web server" and create a virtual directory.
  6. Save.
  7. Shift+F5 to run the app. You should see http://localhost/MvcApplication1/ and an IIS error HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory..

It's clear that for whatever reason, ASP.NET routing is not working correctly.

Things I've already thought of and tried:

  • Verified that all IIS features are enabled in "Turn Windows features on or off".
  • Verified that the default website is configured to use .NET 4.0
  • Reassigned ASP.NET v4 scripmaps via aspnet_regiis -i in the v4.0.30319 directory.

Here's the most amazing part - this is on a just-built machine. New copy of Windows 7 x64 Ultimate, clean install of Visual Studio 2010 Premium, no other websites and no other work performed.

Anything else I can try?

Setting Visual Studio to use local IIS web server

like image 666
Portman Avatar asked Apr 17 '10 18:04

Portman


People also ask

What is Microsoft ASP NET MVC 2?

ASP.NET MVC 2 is a framework for developing highly testable and maintainable Web applications by leveraging the Model-View-Controller (MVC) pattern.

How deploy MVC application on local IIS?

Right-click on your ASP.NET MVC5 application inside Visual Studio and then click "Publish". Now, select the "IIS" option from the left menu and click "Create Profile" button. Change your publish method to "Web Deploy Package" and provide your package location, then click "Next". Click "Save" on the next screen.

Is ASP NET MVC deprecated?

Note that the entire ASP.NET MVC library is now obsolete.

How do I run an ASP file in IIS?

Click Start, and then click Control Panel. In Control Panel, click Programs and Features, and then click Turn Windows Features on or off. Expand Internet Information Services, then World Wide Web Services, then Application Development Features. Select ASP, and then click OK.


1 Answers

Ok, this is resolved for me, by doing the following:

Running aspnet_regiis -i in the 32-bit directory c:\Windows\Microsoft.NET\Framework\v4.0.30319.

At this point, I don't understand why 64-bit mode isn't working, but I'm now unblocked. Hopefully this helps anyone else who is having this issue.

like image 85
Portman Avatar answered Oct 12 '22 00:10

Portman