案例:让IIS中ASP.NET 1.1与2.0并存

今天一个客户说他找了一个人上去他的服务器装了一个.net 1.1,然后我做的.net 2.0的站就无法访问了,报错如下:

Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.

Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.

以下是我的解决办法:

首先,由于他是先有2.0,再装1.1的。由于1.1出生的时候还没有2.0,安装程序还不够智能,会把2.0的IIS的注册覆盖掉,所以必须重新注册2.0(先装1.1,后装2.0的可跳过次步)

在命令行模式下键入以下命令

  • cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
  • aspnet_regiis –i

最好先CD进.Net较新版本的目录下再执行aspnet_regiis,否则可能会受Windows全局Path变量的影响,导致其他版本问题

然后,进入IIS管理器,新建一个应用程序池叫做“ASP.NET 1.1”

在需要运行在1.1版本的站点下点 右键->属性->主目录 选项卡中的应用程序池选项中选择“ASP.NET 1.1”

最后,在站点属性的ASP.NET选项卡中选择 1.1.4322

重启IIS,这样1.1和2.0的站就可以在不冲突的环境运行

不允许评论