ASP.NET MVC running IIS7 deployment problem - asp.net-mvc

I am having trouble deploying an ASP.NET MVC app to IIS7.
I have an MVC project created with ASP.NET MVC Beta 1. It consists of nothing more than the default template unmodified.
The app runs just fine within VS2008, but when I publish it to a local IIS7 website (http://localhost), I get the following server error:
The incoming request does not match any route
I have also tried unsuccessfully to access http://localhost/Home/About (a route to a specific page within the template). This returns a 404 error.
I have recreated the website in IIS several times and ensured the pipeline mode is set to integrated. My IIS7 server is running on my Vista Home Premium machine.
I am assuming this is an IIS configuration issue any suggestions as to configuration issues with ASP.NET MVC apps would be appreciated.
Any thoughts?

http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx
This solved all my problems.

Does IIS run ok with the default IIS7 site?
Are you receiving any Event Viewer messages?

Is IIS in Integrated Mode? If it's not, you'll have to do some setup or change it to Integration Mode

Please make sure that you are running under IIS 7.0 Integrated mode. If you need to run it under IIS 7.0 Classic mode, you need to perform several actions to make the routes work. Please refer the following blog posts;
http://www.tugberkugurlu.com/archive/running-asp-net-mvc-under-iis-6-0-and-iis-7-0-classic-mode---solution-to-routing-problem
http://www.tugberkugurlu.com/archive/deployment-of-asp-net-mvc-3-rc-2-application-on-a-shared-hosting-environment-without-begging-the-hosting-company

You need to install these software requirements:
AspNetMVC3ToolsUpdateSetup
wpilauncher_3_10(Select: Application Request Routing 2.5)

Related

MVC site deployed to IIS 7 Homepage work All other page 404

I'm trying to deploy a MVC 3 site to IIS 7.5. The deafult route works but all links return a 404 error including if I manually enter the link for the homepage.
Details:
MVC 3 to IIS 7.5
Windows Server 2008 R2
MVC 3 is installed on server
Default Web Site/PaedPhysiotherapy_Uat
.net 4 is installed
DeafultApplicationPool used
App pool is .net4 and running in integrated mode
Custom error are turned off
If I deploy to a new website on the same IIS box using different ports, e.g. "http://newsite:81 which not under the default website everything works fine.
Even in the absence of routing, IIS will redirect requests for "/" to "/Default.aspx". In an MVC app, there's a Default.aspx which manually finds the MVC handler and invokes it. So that's probably why your home link works.
Your other pages must go through routing. In integrated mode there must be an IIS handler for this. Check the ExtensionlessUrlHandler in the IIS handler mappings. Compare that and other handlers with the sites which work.
At a guess, if this works when deploying to the root of a site then it looks like an absolute path has sneaked in. Perhaps somewhere this is a missing ~ in front of a path e.g.
/MyController
instead of
~/MyController
Also, you did remember to convert /PaedPhysiotherapy_Uat to an application?

404 error when running MVC app on IIS 7 classic pipeline

I have a MVC application that works on cassini, works on IIS 6, but I have issues with in IIS 7. I think my issue has to do with how IIS 7 handles threading in a integrated app pool. So to test my theory I'm trying to get my MVC app running in classic mode on IIS 7. I set my app pool to classic and I add a wildcard script for aspnet_isapi.dll. According to all the documentation I've found this is all I should need to do to get MVC running in IIS 7 classic. However when I try and access the web site I get a 404 error. What am I missing?
You need to turn on wildcard script mapping for MVC to work in Classic mode, I think. If not it expects an .aspx file (or similar) to exist for it to handle the execution pipeline over to .NET from IIS.
Find the "Handler mappings" icon on you rsite, and the "Add wildcard Script Map" on the right hand side.
Map it to c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll or whatever version of the framework you are using.
A few things that come to mind right away:
Your web server may not have the ASP.MVC Framework installed, and your web app deployment doesn't include the MVC dll.
The app pool behind your web site isn't running in ASP.NET mode.
Your web bits aren't where you think they are (simple file location misunderstanding)

How can I use my local iis and mvc to work together?

I have started a new mvc project and clicked on project\properties\web - use local IIS server (mine is 5.1). I've created a virtual directory all ok.
When I run I get a 403 error - in url http://localhost/myProjectName/
I have set IIS to windows integrated security and set web.config to windows.
My ultimate goal is to use mixed windows and forms authentication for an intranet app.
I appreciate any help.
I don't believe this will work off the bat for IIS 5.1. By default, MVC controllers/pages don't have extensions, and so IIS doesn't know who to forward the request to during the request pipeline.
In IIS 6.0, you can set a IIS wildcard mapping forward all unknown files to the ASP.NET engine. For 5.1, you'll probably have to configure MapRoutes so that your urls include the mvc extension:
http://localhost/myproject/home.mvc
It can work. Solution is not elegant but it does exist.
Take a look at my article IIS vs. ASP.NET URL Rewriting

ASP .NET MVC Deployment issue on the host

I am trying to deploy a MVC application on IIS7. The IIS is configured to integrated pipeline. When I am using the full path (for example: http://mysite/Controller/Action), I am getting - 404 Not Found.
The MVC is installed on the hosting server.
Does anyone have any idea what the problem could be?
It sounds like a configuration issue, but you might want to check out the ASP.NET Routing Debugger to see what the server thinks is going on.

Can MVC run on 3.5 IIS6? NON SP1

I was lead to believe that MVC apps were BIN-deployable, so could be deployed to any ASP.net 3.5 compatible server. I'm trying to deploy to a Windows Server 2003 x64 with 3.5 (no SP1) and am having trouble getting it working.
I get the following when hitting the homepage, which redirects to the /Account/LogOn view due to our app config.
The page cannot be found
I've got the three (plus Extensions, I can't remember why) MVC dll's set to Copy Local, so they end up in the bin-folder. I'm publishing and then copying over the app to the server:
System.Web.Abstractions.dll
System.Web.Mvc.dll
System.Web.Routing.dll
System.Web.Extensions.dll
Does anyone know what I'm doing wrong? The app works on another machine we have with 3.5 SP1, and on development machines, also SP1 and with MVC installed.
I've gone over everything I can think of, ensured the permissions are correct, etc.
IIS 6 does not handle .mvc extensions correctly. Among other things you have to map .mvc to the ASP.NET handler. Here is a walkthrough for you: http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
Have you set up wildcard mapping on the server that does not work? See "Deploying ASP.NET MVC to IIS 6" for an example. You basically need to map all requests to the ASP.NET ISAPI DLL and tell IIS not to try to verify that the file exists. Don't know if that's your issue, but it has bitten me a few times in deployments.
With IIS6, you can't do extensionless URLs like /Account/LogOn. You have to do something like /Account.aspx/LogOn The ".aspx" can really be almost any arbitrary extension, but you need that extension. Your routes need to take the extension into account as well.
Check to make sure the app pool your site is running under is configured to run ASP .Net 2.0, sometimes it defaults to 1.1 which causes issues similar to yours.

Resources