Going live with a MVC site - asp.net-mvc

I just moved my site to my server which is windows 2003 sp2, sql 2005.
I have a mvc site running on my server (althought i have it turned off) it works fine but my new site does not work correctly
For some reason the routing fails to work on my server. I can hit the homepage fine using the domain but clicking on any link(or typing it in) results in simply a page not found issue!
"The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable."

MVC doesn't play so well with IIS6 out of the box. Have you configured a handler for either .mvc or a wildcard handler?

You need to make your MVC assemblies bin deployable: http://www.britishdeveloper.co.uk/2010/05/mvc2-deploy-could-not-load-file-or.html

Related

ASP.NET 4.5.1 MVC 5 application not loading in browser. Failed to open http://

Problem
I am using windows authentication with MVC5 ASP.NET application. When I went to the url of the application on my intranet, I typed in (just for example), http://derp.herp.edu. As expected, it
asked me for my login credentials on the domain. I entered these.
I then get a completely blank page. No error message. Just a white screen. I then fired up the debugger in my browser and it simply states:
Failed to open http://derp.herp.edu
Details
I don't even know where to find an error for this? I have no clue to what is causing this. I've been trying to look for logs, but since I am new to IIS7.5 I am not sure I am looking at the right ones.
I just deployed the MVC5 on an IIS7.5 Windows 2008 R2 server. It is my belief that the IIS I am trying to deploy this on is on a secured VLAN.
Attempts
Launched locally on my machine IIS7.5. It works. What the heck?
Moved to wwwroot of the inetpub file to make sure file permissions are okay on server.
Associated the default web site on IIS7.5 to the domain name. I can see it on my local machine and the server in the browser.
Thus, we know the domain name works. We know that authentication is trying to work. But something is going wrong when it tries to display the MVC 5 .NET application.
I figured out the error. It was a completely silent error as the browser was just sitting there not doing anything. I started checking IIS and noticed that .NET compilation had some problems. I found the fix at ASPNET4BreakingChangesAndStuffToBeAwareOf.

ASP MVC 2 with asp.net development server won't load default controller & action for an empty route

This used to work fine, but recently it refuse to load the default page for an empty route, instead it lists directory contents.
for example
http://localhost:1234/ should take me to the same page as http://localhost:1234/Home/Index assuming global.asax hasn't been modified, however recently it just takes me to "Directory List -- /" and lists out the content of the project folder.
This is using the ASP.NET Development Server. The sites work fine when deployed into IIS on a server.
Does anybody have any ideas, this is really annoying!
I would check the project settings like suggested on this other question:
Launching my debug MVC3 application opens a specific .cshtml file in the browser
Through trial and error I've determined that this is caused by the IBM RTC plug-in, when disabled it works normally.
I find this very surprising, but I've double checked and it is definitely that!

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?

asp.net mvc - site works fine locally but not after deployment

i have an asp.net mvc website. http:/mywebsite.com (just for this example)
I have been testing this asp.net mvc website locally on my machine and everything works fine on my local machine during testing. When i deploy to my web server
when i bring up http://mywebsite.com it goes to HomeController and load the view Views/Home/Index.aspx (which is perfect). So the main default page is fine.
The issue is, if i click any other other links (again that all seem to work fine locally) i get the following error:
The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Please try the following:
* Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.
* If you reached this page by clicking a link, contact the Web site administrator to alert them that the link is incorrectly formatted.
* Click the Back button to try another link.
HTTP Error 404 - File or directory not found.
Internet Information Services (IIS)
some examples would be:
http:/mywebsite.com\Photos
http:/mywebsite.com\Links
there definitely are controllers and views setup for this (or it wouldn't work locally).
does anyone have any idea how this might work fine locally but somehow on the webserver it doesn't
Are you running the site on II7 in integrated mode? If not, you need to add a wildcard handler so that all URLs get mapped to your application. See Phil Haack's blog post on running ASP.NET MVC ON IIS 6.
Something else to watch out for. I had a static website - deployed on IIS 7.5. Added some MVC Controllers to handle some simple server side apps and then re-deployed it. I didn't copy the web.config file, because I wrongly assumed that everything that was needed was in the one that was automatically created by the server.
You must copy the web.config up as well.

Views does not open in live MVC application

After I published my application none of links works in web site except default.aspx. When I clicked them "page not found" is shown. I guess, it is about routing. But I did not do any change on default mvc routing settings. What could cause this kind of thing?
Thanks.
Verify that IIS which hosts your published web site has all the correct settings to run ASP.NET MVC (see this for on how to set up IIS 6 and this for IIS 7).
One would need more details to debug the issue. On a quicker note, first check for server logs (IIS/Apache) - it would indicate whether the request reached the server or not, where was the requested routed to, who processed it and what happened. Also check for server error logs.

Resources