PDA

Click to See Complete Forum and Search --> : Deployment Issues With MVC


honeybee
May 12th, 2011, 11:02 AM
I have an MVC app that runs fine from within VS2008. I want to publish it on my local IIS. However after publishing when I try to access it through localhost, it returns an error:

The website declined to show this page.


Ordinarily when I call the website URL, the default index page should get called, and typing the names of any of the controllers should invoke the respective views. However all I get is this error.

What is missing from the deployment? I already tried setting CopyToLocal = true for the three MVC assemblies, but no luck.

.

Krokonoster
May 13th, 2011, 05:53 PM
What version of IIS are you using? (If for some reason you got IIS6, just google that. Some issues there I never had to bother with)
Is the application pool for the site set to Asp.Net 4.0 (Integrated)? (in IIS)

honeybee
May 16th, 2011, 10:36 PM
I finally got it to work on my local IIS 5.1. I tried to install the MVC patch for IIS, but never know if it was installed or not. I have no way to verify that. Apart from that I changed the global.asax code to alter the routing so I can call my controllers by adding the ".aspx" extension (found it after googling). So my local website is now up and running.

The problem persists with IIS 6.0 on the deployment machine. It's Win 2003 and IIS 6, which is the only difference from my development machine. I was hoping the routing changes would take care of things pretty much on all IIS versions, but unfortunately that doesn't seem to be the case.

Latest:

I tried the steps discussed here:

http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

Specifically:

1. I have the virtual directory set up with mapping of ".mvc" extension to the ASP.Net ISAPI (mapping for ".aspx" already exists).
2. I have the global.asax.cs modified to set up routing on ".aspx"
3. Now if I add wildcard mapping, nothing on my site works.
4. If I remove the wildcard mapping, only the static html page is served. Any controller requests (made without extension, with extension ".aspx" or with extension ".mvc" are met with 404 - page cannot be found error.

.

honeybee
May 18th, 2011, 03:03 AM
This is a desperate question: Is there any way to convert the MVC application into a typical Web Forms application? This is my last resort, but as I am running out of time, I am more and more inclined to pursue this course of action, however absurd.

.