IISExpress 7.5 has Internal Server Error, whereas IIS 7.5 works

不想你离开。 提交于 2019-12-13 03:57:20

问题


I have the following <handlers /> section in my web.config to register ActiveReports 6 handlers for various file extensions:

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

This works fine under IIS 7.5 under Windows Server 2008 R2 when the Application Pool is configured to use .NET 4.0 in the Integrated Pipeline mode.


If I try to run the same application with this exact web.config under IIS Express 7.5, I receive the following confusing error message:

**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'

This error message doesn't make much sense especially if I change the unique "name" property to something else and the error message adapts accordingly. (it's unlikely that ActiveReportsRpxHandler6161616161 is duplicated some place else)

This IISExpress instance follows the following 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>

Any clue what's up with IIS Express 7.5? Or am I doing something stupid here?


回答1:


Maybe the handler is registered somewhere up in the config file chain. See details about it at http://msdn.microsoft.com/en-us/library/ms178685(v=vs.100).aspx. Alternatively, you can try

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


来源:https://stackoverflow.com/questions/13038241/iisexpress-7-5-has-internal-server-error-whereas-iis-7-5-works

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!