0

I am trying to make Visual Studio 2010 to run my project under a local instance of IIS 7.5 instead of starting the web development server. There is no problem deploying it to IIS, but when i try to browse to the site, it's like the routes never been registered in IIS because i get error "The Web server is configured to not list the contents of this directory." when i try to browse "http://localhost/returnjson", and when i browse "http://localhost/returnjson/Home/Index" i get error 404. And there is nothing wrong with the routes in my project, it works under web development server. What could be the problem?

3 Answers 3

5

It's hard to say what's wrong here but there are a couple of things you could try.

You could be looking at the wrong application. IIS comes pre-configured with a default application that acts as a catch all. Any unmapped domain name will end up there. So, by default when you visit localhost you'll end up there.

If you deployed your application into a new IIS site, make sure you bind it a proper domain name like myapp.local. Then add that domain name to your hosts file (%Windows%\System32\Drivers\etc\hosts) and map it to IP 127.0.0.1.

Another thing that could be wrong is that your IIS configuration is a bit screwed up. It happens sometimes. You can fix that with aspnet_regiis like so:

aspnet_regiis -ir

This tool is located under:

%Windir%\Microsoft.NET\Framework\v4.0.30319
1
  • you got this error cause' you install IIS after install MVC3, please try aspnet_regiis -ir and it will be run okey!
    – vNext
    Sep 25, 2011 at 10:44
0

Right click on your MVC3 project and select Publish. Publish it to the Filesystem and select a folder on your hard drive.

Navigate to your published folder and copy everything in it.

It's a pain in the keister but you can get through it.

Your folder in C:\inetpub\wwwroot should look like this after pasting your published application into the wwwroot:

enter image description here

Can you confirm that your folder looks like this?

0

You could also try out IIS Express in stead of IIS 7.5

IIS Express is a lightweight, self-contained version of IIS optimized for developers. IIS Express makes it easy to use the most current version of IIS to develop and test websites. It has all the core capabilities of IIS 7 as well as additional features designed to ease website development

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.