IISExpress 7.5有内部服务器错误,而IIS 7.5工作

时间:2012-10-23 19:57:43

标签: asp.net iis web-config iis-7.5 iis-express

我的web.config中有以下<handlers />部分,可以为各种文件扩展名注册 ActiveReports 6 处理程序:

<handlers accessPolicy="Read, Execute, Script">

  <add name="ActiveReportsRpxHandler" path="*.rpx" verb="*" type="DataDynamics.ActiveReports.Web.Handlers.RpxHandler, ActiveReports.Web, Version=6.0.1797.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  <add name="ActiveReportsWebCacheHandler" path="*.ArCacheItem" verb="*" type="DataDynamics.ActiveReports.Web.Handlers.WebCacheAccessHandler, ActiveReports.Web, Version=6.0.1797.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  <add name="ActiveReportsCompiledReportHandler" path="*.ActiveReport" verb="*" type="DataDynamics.ActiveReports.Web.Handlers.CompiledReportHandler, ActiveReports.Web, Version=6.0.1797.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />

</handlers>

当应用程序池配置为在集成管道模式下使用.NET 4.0时,这在Windows Server 2008 R2下的IIS 7.5下可以正常工作。


如果我尝试使用 IIS Express 7.5 下的确切web.config运行相同的应用程序,则会收到以下令人困惑的错误消息:

**HTTP Error 500.19 - Internal Server Error**

**Config Error**    Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'ActiveReportsRpxHandler'

此错误消息没有多大意义,特别是如果我将唯一的“name”属性更改为其他内容并且错误消息相应地进行了调整。 (ActiveReportsRpxHandler6161616161不太可能在其他地方重复)

此IISExpress实例遵循以下applicationhost.config:

<site name="xxxxxxx" id="2">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\Users\xxxxxxx\Documents\Visual Studio 2010\Projects\xxxxxxx\xxxxxxx" />
    </application>
    <application path="/AIMS" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\Users\xxxxxxx\Documents\Visual Studio 2010\Projects\xxxxxxx\xxxxxxx" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:32150:localhost" />
    </bindings>
</site>

任何线索IIS Express 7.5的用途是什么?或者我在这里做些蠢事?

1 个答案:

答案 0 :(得分:1)

也许处理程序已在配置文件链中的某处注册。请参阅http://msdn.microsoft.com/en-us/library/ms178685(v=vs.100).aspx详细了解相关信息。或者,您可以尝试

<handlers accessPolicy="Read, Execute, Script">
  <remove name="ActiveReportsRpxHandler"/> 
  <add name="ActiveReportsRpxHandler" path="*.rpx" verb="*" type="DataDynamics.ActiveReports.Web.Handlers.RpxHandler, ActiveReports.Web, Version=6.0.1797.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  <add name="ActiveReportsWebCacheHandler" path="*.ArCacheItem" verb="*" type="DataDynamics.ActiveReports.Web.Handlers.WebCacheAccessHandler, ActiveReports.Web, Version=6.0.1797.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  <add name="ActiveReportsCompiledReportHandler" path="*.ActiveReport" verb="*" type="DataDynamics.ActiveReports.Web.Handlers.CompiledReportHandler, ActiveReports.Web, Version=6.0.1797.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />

</handlers>