.Net MVC 4 Blank Page - asp.net-mvc

I am trying to deploy the default empty internet application template from .Net MVC 4, my app gives the same problem so figured start with the simplest app I could.
The server is 2008 R2 running .Net 4 (app has been changed to 4 from 4.5). I have other sites running on that machine with .Net 4 and MVC 3 but the MVC 4 app just brings up a blank page. I have confirmed HttpRedirection and HttpErrors are installed (and the MVC 3 apps run fine).
I have tried the solution from Michel van Engelen here I am getting a blank page while deploying MVC application on IIS and confirmed it works on my machine but still a blank page.

I ended up adding ELMAH to try get info on the exception that was causing the problem and the site started working, I am not sure what changes to the web.config to install ELMAH resulted in the site starting but did the same thing to my other original app and all is now fine.

Related

Deploying MVC 3 application in MVC 4 hosted IIS

I have created MVC 3 application, everything is working fine.
Now we moved for deployment. However the IIS 7 got already installed with MVC 4 and running other MVC 4 application.
Can I simply host my MVC 3 application? Or do I need to do any changes in web.config, or global.asax etc? Any breakdown will happen?
I developed MVC 3 with Razor.
You can install MVC3 and and MVC4 side by side, but you may need to follow the advice here
If you don't want to install MVC3 on the server, simply BIN deploy it and make the changes in the attached link. That way you'll risk no knock on effects to other apps.

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)

Deploy asp.net mvc beta to iis 6 causing 404's

I'm struggling to get around the 404 errors from asp.net mvc beta when deploying on IIS 6. I had this working in one of the previews by mapping .mvc in IIS but this no longer works. I've read Omar's post and several others on the web and tried their solutions but no luck so far.
The home page opens without a problem on IIS 6 but others 404 and the site runs well on IIS 7.
Has anybody deployed asp.net mvc beta to IIS 6 with success? If so, what adjustments did you need to make to the code and/or IIS settings to get it to work?
I found a solution to my problem from Steve Sanderson's blog (Thanks Steve):
Use a wildcard mapping for aspnet_isapi.dll. This tells IIS 6 to process all requests using ASP.NET, so routing is always invoked, and there’s no problem. It’s dead easy to set up:
open IIS manager (run -> inetmgr -> OK)
right-click your app, go to Properties
then Home Directory tab, then click Configuration.
Under Wildcard application maps, click Insert (not Add, which is
confusingly just above)
then enter
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll for
“Executable”, and uncheck Verify that file exists.
I can't seem to write comments yet. So I'll write a new answer.
There are a few similar questions going around on stackoverflow.
I'm using MVC 3. I know the question was MVC 2 related. But since this is the first stackoverflow post I bumped in to, I think it's worth mentioning that:
when you use MVC 3, you need to add a new extension mapping with the executable of the .NET 4 framework (C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll)
<edit>I just found out that I even don't need to set up the extension mapping. </edit>
It still didn't work for me then :) I still had to 'Allow' ASP.NET v4.0.30319 in the Web Service Extensions section in IIS:
open IIS
click on the server node
open the Web Service Extensions section
select the ASP.NET v4.0....
right click --> Allow
Good to go!
Url rewriting can help you to solve the problem. I've implemented solution allowing to deploy MVC application at any IIS version even when virtual hosting is used.
http://www.codeproject.com/KB/aspnet/iis-aspnet-url-rewriting.aspx

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