DCSIMG
Installing a Production Server for ASP.NET MVC 2 – Part 2 - Gil Fink's Blog

Gil Fink's Blog

Fink about IT

News

Microsoft MVP

My Facebook Profile My Twitter Profile My Linkedin Profile

Locations of visitors to this page

Creative Commons License

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
© Copyright 2013 Gil Fink

Hebrew Articles

Index Pages

My OSS Projects

English Articles

Installing a Production Server for ASP.NET MVC 2 – Part 2

Installing a Production Server for ASP.NET MVC 2 – Part 2

A few days ago I helped a client to solve a problem they had when they deployed an ASP.NET MVC 2 application. .Net Logo with ASP.NETIn a previous post I wrote about how you can install a production server in order to run ASP.NET MVC 2 application. The client team have installed the server according to the AspNetMVC2 MSI installer section (in my post) and then they used Phil Haack’s IIS6 Extension-less URLs solution to enable the routing engine. Life was beautiful and they were on the right track.

But…
running the application produced the “page cannot be found” page:

Page not found

This made them and me to scratch our heads. So the first thing to do in such cases is to check the IIS log file which can be very helpful by holding the error code which was 404.2. While Googling the net we found the Getting an ASP.NET 4 application to work on IIS6 post by Johan Driessen which holds the solution. Apparently when you install .Net 4 on Windows Server 2003 with IIS6 the .NET 4 ASP.NET ISAPI extension is installed disabled…
By using the following command through the command line you can check whether the ISAPI is enabled:

cscript iisext.vbs /ListFile
If you find out that the status for the .NET 4 ASP.NET ISAPI extension is 0 then in order to enable it you will need to run the following command in the command line:
cscript iisext.vbs /EnFile C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll

You need to run both of the previous commands in <WINDOWS DIR>/System32.
That solved the client’s problems and the application is running on the production server now.
Thanks Johan!

Update:
Another option to do the same thing is through the Web Service Extensions in the IIS Manager. All you have to do is to mark ASP.NET 4 in the extension list and press the Allow button. The following figure shows how to do that:
Web Service Extensions

Thanks to Ran Wahle for this tip!

Comments

ASP.NET MVC Archived Buzz, Page 1 said:

Pingback from  ASP.NET MVC Archived Buzz, Page 1

# March 1, 2011 10:43 AM

Installing a Production Server for ASP.NET MVC 2 ??? Part 2 – Gil … - asp said:

Pingback from  Installing a Production Server for ASP.NET MVC 2 ??? Part 2 &#8211; Gil &#8230; - asp

# March 1, 2011 2:31 PM

Ido Flatow said:

Been there so many times... I know your pain.

# March 1, 2011 3:20 PM

Ran Wahle's blog said:

404.2 and , ISAPI restriction and Web Service Extension &#160; A common and very misleading http error

# March 3, 2011 8:46 AM