tags:

views:

261

answers:

1

I recently created an MVC2 application. I am having trouble bringing it up on a Windows 2003 Server running IIS 5.2. My developing machine is Server 2008, so no problems there.

Changes I made on Server 2003 is Creating a Wildcard Script Map of * and pointing that to: c:\windows\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll

I am getting an HTTP 403 Forbidden page.

I created a separate apppool and am running that using .Net 4

Here is my global.asax

routes.MapRoute(
            "Default", // Route name
            "{controller}.mvc/{action}/{id}", // URL with parameters
            new { action = "Index", id = "" } // Parameter defaults
        );

        routes.MapRoute(
            "Root", // Route name
            "", // URL with parameters
            new { controller = "Home", action = "Index", id = "" } // Parameter defaults
        );
+1  A: 

I have similar problem while trying to get working my MVC2 application on IIS 5.1 server. I have lost many hours but finally I got it working.

Your Global.asax looks good, but there is one another thing. On IIS server there is missing mapping for .mvc files. You have to add this in order to get your app works.

Go to you IIS, then roll-up Web sites and right click on Default Web Site and select Home directory. Now click on Configure button. Click on Add in order to add new mapping extension.

In Executable field paste your path to aspnet_isapi.dll file. Usually it's under C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll.

In Extension field write .mvc.

At tasks (I may be wrong about this name, cause I'm not using English version of IIS) mark second option and paste GET,HEAD,POST,DEBUG.

Mark 2 checkboxes at bottom.

Now you can save it by clicking on OK button.

One tip at the end. If OK button is disabled then just click on a field with Executables and it should be enabled then.

Edit Here's another tip. It is quite problematic to run MVC application under IIS 5.x. You have to be careful with all paths. For example to include jQuery library in SiteMaster page you have to use:


<script type="text/javascript" src="<%= Url.Content("~/Scripts/jquery-1.4.2.min.js") %>"></script>

Hope this works for you and it saved you some time :)

Ventus
So for the new mapping extension should I use the v2.0.50727 or the v4.0.30319? The MVC2 Application is a virtual directory underneath the default website. The default website is running on under ASP.NET v2.0.50727 and the virtual directory I created is running under v4.0.30319. Is the mapping you are suggesting I create part of the default site or the virtual directory?
obautista
This is still not working for me. I created the .mvc mapping extension. How many and which ones should I be creating? Also, should they be created under the Virtual Directory or Default Website?
obautista
Figured out that all you need to do is set up the Global.asax like I show above and allow * Script map in the Virtual Directory (running the MVC application). Then, apparently, when installing .Net Framework 4.0 on Server 2003 it leaves the isapi.dll set to Prohibited in IIS/Web Server Extensions. After setting it to Allowed the application came up. The JQuery/IIS5 tip referenced above was a good one. Thanks.
obautista