解决IIS ASP.NET模块注册错误问题

今天为解决WCF在IIS上部署的问题,不慎运行%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r -y,结果所有的IIS注册模块从4.0退回到了3.0,许多4.0网站都不能打开了。错误为:

"Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'"

可能引发此问题的原因:

  • 安装.NET 4后安装IIS
  • 安装.NET 4后安装3.0版本的WCF HTTP Activation Module(我遇到的情况)

解决方法:

管理员身份运行4.0版本的framework下的aspnet_regiis.exe,加参数-iru即可。如:

c:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -iru

这是正确解决方法来源:

http://social.msdn.microsoft.com/Forums/en-SG/wcf/thread/39571e42-aca7-469d-8c68-aa59c2da4fcc

这个人遇到的问题比较接近:

http://stackoverflow.com/questions/2002123/how-do-i-use-a-command-line-tool-to-install-net-4-to-iis

posted on 2010-05-27 15:36  Gildor Wang  阅读(541)  评论(0编辑  收藏  举报

导航