Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Framework 1.1 on IIS 7

I have inherited a .NET Framework 1.1 web site that I must host with IIS 7 on Windows Server 2008. I'm having some trouble.

1. Installation

I installed .NET Framework 1.1 following these instructions.

The installation automatically created a new Application Pool "ASP.NET 1.1". I use that.

2. Trouble

When I launch the web site I see web.config runtime errors:

The tag contains an invalid value for the 'culture' attribute.

I fix that one and then see:

Child nodes are not allowed.

I don't want to keep playing this whack-a-mole game. Something must be wrong.

3. Am I sure this is .NET 1.1?

I examine the automatically created application pool. I see that it's 1.1.

Advanced Settings...

Automatic AppPool .NET 1.1 Advanced

Basic Settings...

Automatic AppPool .NET 1.1 Basic

This doesn't seem right.

While 1.1 is set, it's not an option in the Advanced drop down selectors.

And why in the Basic box is it just "v1.1" and not ".NET Framework v1.1.4322"? That would be more consistent.

4. I cannot create other .NET 1.1 App Pools

I cannot select .NET Framework 1.1 for other application pools. It's not an option in the drop down selectors. What's up with that?

App Pool missing .NET 1.1 option

What now?

  • Why isn't v1.1 an option for all AppPools?
  • How can I verify my application is in fact using .NET Framework 1.1?
  • Why might I get these runtime errors?
like image 401
Zack Peterson Avatar asked Dec 21 '10 17:12

Zack Peterson


People also ask

Is .NET 1.1 still supported?

It's no longer supported. If you try to install the package, the following error message is displayed: "Setup cannot continue because this version of the . NET Framework is incompatible with a previously installed one." To solve this problem, install . NET Framework 3.5 SP1.

How do I enable .NET Framework in IIS?

Enabling Windows Internet Information Services (IIS)On Windows Server, open the Server Manage and select Local Server. At the upper-right of the screen, select Manage and then select Add Roles and Features. In the Server Roles tab of the Add Roles and Features wizard, check the Web Server (IIS) box.

Does IIS use .NET framework?

NET Framework 4.5 is the default on IIS 8.0.


3 Answers

A quick-fire way to find out if the application is running under 1.1 is to knock up a quicky script that displays the environment version:

<%@ Page Language="C#" %>
<script runat="server">
    void Page_Load(Object sender, EventArgs e)
    {
        Response.Write(System.Environment.Version.ToString());       
    }
</script>

Or if you're getting yellow screens of death then you'll see the version number at the bottom of the page: alt text

I suspect the reason you can't select Framework v1.1 when adding a new application pool or modifying an existing one is that the 1.1 installer doesn't know how to add some critical piece of metadata or config info to IIS.

.NET 2.0 ships with 2008 and .NET 4.0 being a later product is IIS7 friendly as well so there is most likely better IIS integration. Or, v1.1 doesn't have some essential nugget of metadata that IIS7's InetMgr needs to be able to add this to its various lists.

The reason you can see v1.1 in the drop downlist for the ASP.NET 1.1 pool Basic Settings dialogue and not the other pools is because it's already been set and so will just be included in the list. I experimented and changed this on the newly created ASP.NET 1.1 pool and set it to 2.0, saved, then re-opened. The result is that v1.1 isn't visible any more.

Additionally the reason it's called v1.1 and not .NET Framework v1.1.4322 is because the value is being picked up from the managedRuntimeVersion attribute in the app pool config in applicationHost.config. The reason that versions 2.0 and 4.0 show a full description is that there's probably some piece of IIS friendly metadata with a resource string being looked up that isn't present for 1.1.

To set a pool to use v1.1 at creation time you have to manually set the managedRuntimeVersion attribute using APPCMD.EXE:

appcmd add apppool /name:"NewPool"  /managedRuntimeVersion:"v1.1"

This is explained at the bottom of the article you linked to.

To change an existing pool to use 1.1 you must also use the command line APPCMD.EXE tool:

appcmd set apppool /apppool.name:"SomeOtherPool" /managedRuntimeVersion:"v1.1"

Interestingly you can set managedRuntimeVersion to any old value:

alt text

I wish I could explain away why the ASP.NET 1.1 application pool magically gets created or how the installer manages to do the right thing with the handler mappings (somehow all the correct preConditions are set, so either the installer has been updated or IIS has some kind of trigger to look for 1.1 being installed and fix up things).

Update:

I contacted Bill Staples, the author of this article:

How to install ASP.NET 1.1 with IIS7 on Vista and Windows 2008

I asked him about how the 1.1 installer or IIS7 manage to do the right thing regarding handler mappings, creating the "ASP.NET 1.1" application pool and so on. This was his reply:

"If memory serves, in Vista/Windows 2008 there was an application compatibility shim created which would detect the 1.1 installer and do the app Pool creation/handler mapping. However, in Windows 7 / Windows Server 2008 R2, .NET framework 1.1 is no longer supported and I wouldn't be surprised if this code was pulled, though I don't know for sure."

So mystery solved.

like image 133
Kev Avatar answered Oct 12 '22 17:10

Kev


I encountered the same problems whilst trying to install an old .Net 1.1. on Win2k8/IIS7. In the end I found it was easier and quicker just to bump everything to .Net 2.0. I would recommend you do the same.

Unless your code is doing anything exotic the porting process can be carried out in day or less for reasonably large projects.

like image 34
madman1969 Avatar answered Oct 12 '22 17:10

madman1969


Windows 2008 doesn't have .NET 1.1 installed. You can manually install .NET 1.1.

like image 1
mrdenny Avatar answered Oct 12 '22 18:10

mrdenny