How to run asp.net mvc3 app
Is this possible to run/deploy asp.net mvc3 on xp ?
开发者_StackOverflowpublishing it via vs2010 and then browsing in IE/Firefox gives this error message
Directory Listing Denied
This Virtual Directory does not allow contents to be listed.
Enabling directory browsing does not help as there is no default.aspx to run ?
Sorry my web dev skills are a "bit" rusty !
The problem is that ASP .NET MVC is based on URL routing and for that to work, the request needs to be parsed by ASP .NET, problem is that without the .aspx extension it won´t get parsed (IIS 6 problem iirc).
So you have to change the URL routing of MVC and/or map an extension to the ASP.NET request handler
Check out this link for the details: http://haacked.com/archive/2010/12/22/asp-net-mvc-3-extensionless-urls-on-iis-6.aspx
Your questions does not give a lot of information. If i were you, i would start by.
- What URL are you trying to hit?
- I would check routes in global.aspx.cs
- try and put a test.htm in the root folder and hit it from IE and see if your iis server is setup correctly.
I suspect you are not configuring the application properly in IIS. Please use these steps to configure it.
MVC3 publishing and IIS 6
I've got an MVC3 application running fine on a Windows Server 2003 machine running IIS 6. The only need was to install the .net 4.0 framework on the machine and then from the MVC project tell the project to bin-deploy the files needed to run ASP.net MVC. These .dll's should end up in the application's bin folder after a publish:
- System.Web.Routing
- System.Web.Abstractions
- System.Web.Mvc
After that you should be ready to go.
The quick and dirty reason an MVC3 application is easier to deploy now is that Microsoft has tweaked the 4.0 framework to easily setup routing which MVC depends on. You can get the latest version of the .net 4.0 framework from Web Platform Installer.
Good luck and hope this helps some.
精彩评论