最可能的原因: 
•    此应用程序在 system.web/httpModules 节中定义配置。 
可尝试的操作: 
•    将配置迁移到 system.webServer/modules 节。也可以手动这样做,或通过在命令行中使用 AppCmd 来这样做 - 例如,%SystemRoot%\system32\inetsrv\appcmd migrate config "Default Web Site/"。使用 AppCmd 迁移应用程序将使它能够在集成模式下工作,并能继续在经典模式下和以前版本的 IIS 上工作。 
•    如果您确信可以忽略此错误,则可以通过将 system.webServer/validation@validateIntegratedModeConfiguration 设置为 false 来禁用它。 
•    也可以将应用程序切换到经典模式应用程序池 - 例如,%SystemRoot%\system32\inetsrv\appcmd set app "Default Web Site/" /applicationPool:"Classic .NET AppPool"。只有在无法迁移应用程序时才这样做。 
(将“Default Web Site”和“Classic .NET AppPool”设置为您的应用程序路径及应用程序池名称) 
链接和更多信息集成模式是在 IIS 7.0 上运行 ASP.NET 应用程序的首选模式

{ IIS 的应用程序池根据托管管道模式分了两种类型:集成和经典两种

集成 .NET 模式下,应用程序不应在
<system.web>/<httpModules> 配置节中指定 ASP.NET 模块组件,而应使用
<system.webServer>/<modules> 配置节来加载 ASP.NET 模块组件。

经典.NET 模式 则是我们以前习惯的IIS 6 的方式,没有上述限制。}

解决方法:

方法1在IIS7上配置应用程序池.

方法2:在IIS7添加我们的模块(modules)

参考:http://aabs.wordpress.com/2007/11/16/ihttpmodule-not-running-after-conversion-to-iis-7-and-net-35/

方法3:修改web.config

再细了解:

IIS7的Application
Pools有两种mode,一种是Integrated,一种是classic。如果使用Integrated模式,那么对自定义的
httpModules和httpHandlers就要修改配置文件了,需要将他们转移到<modules>
和<hanlders>节里去。

IIS7的两种模式和IIS6有什么区别?

IIS7.0 Integrated mode:asp.net
的modules和handlers从<system.webServer>下的<modules>
和<handlers>里读取,以前的<system.web>下的<httpModules>
和<httpHandlers>配置节会被忽略,如果设置禁止验证(disabled validation),是不会产生错误的。

IIS7.0 Classic mode:与以上情况是相反的,<modules>和<handlers>会被忽略。

IIS6.0 :这个大家都不陌生了。

如果做一个可以在IIS6和IIS7的两种mode下都可以运行的配置?validateIntegratedModeConfiguration=“false”是做什么用的?有需要的朋友可以在这里查看详情。

其次,从iis6迁移到iis7上后,有些url rewrite功能可能就不好用了,下面这篇文章讲述了一个hack方法,有效的控制了staticFile handler的职责,实现了像iis6那样的工作方式。

示例代码:

 

<system.web>
   <!-- Modules for IIS 6.0 and IIS 7.0 Classic mode -->  
  <httpModules>          
    <add name="MagicAjaxModule" type="MagicAjax.MagicAjaxModule, MagicAjax"/>    
  </httpModules>
   <!-- Handlers for IIS 6.0 and IIS 7.0 Classic mode -->   
    <httpHandlers>
      <addpath="*.myh"verb="GET"type="MyApp.MyHandler" />
    </httpHandlers> 
</system.web>
<system.webServer>
  <!-- Modules for IIS 7.0 Integrated mode -->    
  <modules>        
    <add name="MagicAjaxModule" type="MagicAjax.MagicAjaxModule, MagicAjax"/>    
  </modules>
  <!-- Handlers for IIS 7.0 Integrated mode -->   
   <handlers>
      <addname="MyHandler"path="*.myh"verb="GET"type="MyApp.MyHandler"preCondition="integratedMode" />      
    </handlers>    <!-- Disable detection of IIS 6.0 / Classic mode ASP.NET configuration -->      
   <validation validateIntegratedModeConfiguration="false" />
 </system.webServer>

ASP.NET程序从IIS6移植到IIS7时出现500.22错误的更多相关文章

  1. ASP.NET程序从IIS6移植到IIS7时出现500.22错误(转)

    最可能的原因: •    此应用程序在 system.web/httpModules 节中定义配置. 可尝试的操作: •    将配置迁移到 system.webServer/modules 节.也可 ...

  2. 解决微信小程序用 SpringMVC 处理http post时请求报415错误

    解决微信小程序用 SpringMVC 处理http post时请求返回415错误 写微信小程序时遇到的问题,这个坑硬是让我整了半天 wx.request请求跟ajax类似处理方法一致 小程序端请求代码 ...

  3. IIS7部署报错 500.22错误 检查到这集成托管模式下不使用的ASP.NET配置

    公司的一个项目,环境为: .Net 4.0 + MVC3,部署在Windows Server 2003R2 IIS6.0上面运行正常, 迁移到新服务器Windows Server 2008R2,部署在 ...

  4. Migration of ASP.NET app from IIS6 to IIS7 (7.5)

    For many of us familiar problem. You developing applications under IIS6 and you're about to move the ...

  5. (转)关于X64位系统IIS7下支持32位asp.net程序

    最近在windows2008 x64位系统下的IIS7下部署asp.net程序. vs2005或vs2008默认的情况下是Any cpu 的也就是支持x86和x64两种系统的.可我的程序在引用了一个三 ...

  6. 将Web站点由IIS6迁移至IIS7

    最近开始着手逐步将所有的Web站点由Win2003+IIS6迁移至64位Win2008+IIS7,基本还算顺利.这里就把相关内容整理总结一下.首先自然是要安装基本运行环境,包括iis,.net fra ...

  7. IIS5.1、IIS6.0、IIS7.5中安装配置MVC 3

    本文主要介绍在IIS5.1.IIS6.0.IIS7.5中安装配置MVC 3的具体办法! 正文: IIS5.1 1. 安装Microsoft .net FrameWork 4.0安装包; 2. 安装AS ...

  8. 部署 外网 ASP.NET程序时, IIS安全性 配置 -摘自网络

    最近,和朋友们在聊及ASP.NET程序的安全性没有JAVA高,IIS(Internet Infomartion Server)的存在很多漏洞(以及新型蠕虫,例如Code Red 和Nimda),安全得 ...

  9. ASP.NET 程序发布详细过程

    前言 ASP.NET网站的发布,无论是初学者还是高手,在程序的发布过程中或多或少会存在一些问题,譬如VS发布ASP.NET程序失败.IIS安装失败.IIS发布失败.局域网内不能访问 配置文件错误.权限 ...

随机推荐

  1. Merge Intervals——LeetCode

    Given a collection of intervals, merge all overlapping intervals. For example,Given [1,3],[2,6],[8,1 ...

  2. selenium webdriver python 操作Chrome浏览器

    Step1: 下载chromedriver. 下载路径: http://chromedriver.storage.googleapis.com/index.html 选择一个合适的下载即可.我下载的是 ...

  3. Rocketmq整体分析

    之前本人在实际的生产环境中,使用过activemq和rabbitmq消息队列,在使用过程中出现一些难以解决的问题,本文通过产品选型.网络架构和核心特性分析了rocketmq的优势和特性. 产品选型 我 ...

  4. FusionCharts的使用入门

    1. Fusioncharts 介绍: Fusioncharts是一个基于Flash的图表组件,可以用来提供数据驱动的动态图标,fusioncharts可用于任何网页脚本语言如, HTML格式,JSP ...

  5. 从XML文件乱码问题,探寻其背后的原理

    出现应用程序读取XML文件乱码的场景: 加入xml文件以<?xml version="1.0" encoding="utf-8" ?> 格式的:如果 ...

  6. rpc远程过程协议调用

    在linux 5.X以及下的版本你可以通过service portmap status命令查看rpc是否启动.如果提示running,表示正在运行:如果提示stop就是关闭了.如果没有安装,则通过安装 ...

  7. [PWA] 6. Hijacking response

    For example, if the url is not match to any API endpoint, we want to return 404 error message. So fi ...

  8. git 创建远程仓库

    在远程服务器上$ cd /server/path/ $ git init --bare myproject.git 在本地 1> $ cd /client/path/ 运行 git init 2 ...

  9. Python之路,Day4 - Python基础4 (new版)

    Python之路,Day4 - Python基础4 (new版)   本节内容 迭代器&生成器 装饰器 Json & pickle 数据序列化 软件目录结构规范 作业:ATM项目开发 ...

  10. noip 2013 华容道

    /*双向bfs (得分和单项的一样多....)70*/ #include<iostream> #include<cstdio> #include<cstring> ...