.NET Framework 1.1 on IIS 7

久未见 提交于 2019-12-01 17:31:46

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:

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:

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.

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.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!