404 error when running MVC app on IIS 7 classic pipeline - asp.net-mvc

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)

Related

Unable to run Silverlight application from Visual Studio 2010

I'm in the process of setting up a new machine as a development environment and I'm having issues getting an existing code base that hosts a Silverlight application to work. The code runs fine on all other machines that my team uses.
Here is the error:
Error: Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: Could not download the Silverlight application. Check web server settings
I have had a Google around for some answers on this and I realize there is a duplicate question on StackOverflow already, but it does not provide enough information and the answers have not worked for me.
I am attempting to run the solution through Visual Studio 2010 Ultimate, using IIS Express 7.5 integration (as opposed to the Cassini web server). This approach works perfectly fine on all other machines, except for this one.
I have found that if I specify to use full IIS integration (instead of Express) and select the SilverlightTestPage.aspx as the start up page, then the application runs (although not perfectly). Also, if I publish the application and host it on IIS, it again works fine. However, when running through Cassini or IIS Express 7.5 integration, or when trying to get it to run through the Default.aspx or correct start up page it does not work.
Does anyone have any ideas what this might be? I've already checked that the MIME type in IIS is correct (not sure if I can do this in IIS Express as well?) and that the XAP files are building into the correct directory.
Check MIME types in IIS Express configuration file %userprofile%\documents\iisexpress\config\applicationhost.config and make sure that you have MIME types set correctly and restart IIS Express.
Please check the aspx file whether it has the "minRuntimeVersion" correctly for the Silverlight plug in.
<param name="minRuntimeVersion" value="4.0.50826.0"/>
also check the following link for hosting the Silverlight application .
Configuring IIS for silverlight

ASP.NET deployment issues (Not working in release mode)

I have an asp.net mvc 2 application which works fine when run from visual studio either in release or debug mode. When the application is deployed to either a remote or local IIS 7 server in release mode it doesn't work.
The error displayed is as follows:
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Now this is a bit misleading however I have worked out why this error message is being displayed.
The application does not have a default.aspx as this is not needed when running mvc apps on IIS7+
I am using attribute routing which is explained in the link below which uses reflection to build the RouteTable. When interrogating the assembly the attributes are not accessible therefore the RouteTable does not get populated
Since there are no routes the web server attempts to list the directory contents and it does not have permission to do that.
Attribute Routing:
http://itcloud.codeplex.com/
ASP.NET MVC Routing Via Method Attributes
Now my question is what is preventing the application from being able to interrogate the assembly using reflection?
DaTribe
Lack of ReflectionPermission is a likely cause. Many hosting companies over-restrict permissions. Reflection is one that is often problematic. GoDaddy and RackSpace both restrict it.
What trust level is your application running? What hosting provider are you using? Do you have RDP access?

ASP.NET MVC project won't start under IIS 5.1 on Windows XP SP3

I've a ASP.NET MVC 2 project that runs fine under Windows 7 and will start on Windows XP if I use the Visual Studio Development Server, however, starting under IIS generates an error:
Unable to start debugging on the web server
With the message
The specified procedure could not be found
No errors in the system event viewer.
If I start without debugging I get an "HTTP 500 Internal Server Error"
The reason I run it under IIS is the project also includes some WCF wsHttp web services that use certificates, so the VS Development Server is not adequate for hosting those.
I have already seen the links on SO that talk about adding the wildcard mapping. I've already done that, just as I've done on Windows Server 2003 where I successfully host ASP.NET MVC RC2 for quite a while.
See if this helps - its possible but not ideal:
http://blogs.microsoft.co.il/blogs/dorony/archive/2007/12/15/using-asp-net-mvc-on-iis-5.aspx
Check out this blog it might help. IIS 6 and under does not easily support MVC Routing.
http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx
The error said "procedure could not be found" so I double checked the ISAPI dll.
Turns out when I added the wildcard mapping to ISAPI, I picked aspnet_filter.dll instead of aspnet_isapi.dll. Once I switched it, the app starts up fine and serves pages fine.

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.

ASP.NET MVC running IIS7 deployment problem

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)

Resources