Running MVC2 Application on IIS 5.2
Asked Answered
R

2

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
        );
Retrusion answered 17/8, 2010 at 19:53 Comment(0)
T
1

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 :)

Townie answered 17/8, 2010 at 20:3 Comment(3)
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?Retrusion
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?Retrusion
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.Retrusion
J
0

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

and also for

<script type="text/javascript" src="<%= Url.Content("~/Scripts/jquery-1.4.2.min.js") %>">
</script>
Jaenicke answered 13/1, 2011 at 10:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.