IIS 7 上的 .NET Framework 1.1 [英] .NET Framework 1.1 on IIS 7

查看:41
本文介绍了IIS 7 上的 .NET Framework 1.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我继承了一个 .NET Framework 1.1 网站,我必须在 Windows Server 2008 上使用 IIS 7 托管该网站.我遇到了一些问题.

1.安装

我在

我问他 1.1 安装程序或 IIS7 如何设法在处理程序映射、创建ASP.NET 1.1"应用程序池等方面做正确的事情.这是他的回复:

如果没记错的话,在 Vista/Windows 2008 中创建了一个应用程序兼容性 shim,它将检测 1.1 安装程序并执行应用程序池创建/处理程序映射.但是,在 Windows 7/Windows Server 2008 R2 中,.NET 框架 1.1 不再受支持,如果此代码被拉出,我不会感到惊讶,尽管我不确定."

谜团解开了.

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...

Basic Settings...

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?

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?

解决方案

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.

这篇关于IIS 7 上的 .NET Framework 1.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆