2

I am migrating a .net 3.5 ASP.net crystal report application to 4.0 and I am unable to get the reports to display with images.

Leaving the web.config file unchanged with the httphandlers and handlers sections as shown below:

    <httpHandlers>
      <add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
    </httpHandlers>
  </system.web>
...
<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>      
      <add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode" />
    </handlers>

results in:

HTTP Error 500.19 - Internal Server Error

Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'CrystalImageHandler.aspx_GET'

Removing the handlers sections from the web.config file successfully displays the report, but without images.

I am concerned about upgrading the report viewer version as I don't see a clear way to redistribute the crystal viewer 13 in the time frame we have (compared with the version 10.5 that we have used successfully for the last few years). Has anyone had any experience with this? How can I change the web.config file to show reports and show images?

Thanks

reckface
  • 5,678
  • 4
  • 36
  • 62

1 Answers1

4

I updated solution based on your comment

 <handlers>      
 <remove name="CrystalImageHandler.aspx_GET"/> 
  <add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode" />
</handlers>
Emanuele Greco
  • 12,551
  • 7
  • 51
  • 70
  • 1
    Adding results in: HTTP Error 404.4 - Not Found The resource you are looking for does not have a handler associated with it.... but... changing it to worked! – reckface Feb 26 '13 at 15:10
  • oh yese.. there were other handlers that did'nt have to be removed.. just one.. GOOD JOB! – Emanuele Greco Feb 26 '13 at 15:49
  • While this worked on my Development machine it doesn't work on the deployment machine. I'm get: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false" – reckface Feb 26 '13 at 17:24
  • in IIS, iour application is installed inside another one? – Emanuele Greco Feb 26 '13 at 17:34
  • web.config can be configured to LOCK some sections for nested web.config; you must edit parent web.config on overrideModeDefault or allowOverride elems – Emanuele Greco Feb 26 '13 at 17:36
  • admin hadn't enabled any asp.net features on new server install. Now fixed by following: http://stackoverflow.com/questions/9794985/iis-this-configuration-section-cannot-be-used-at-this-path-configuration-lock Thanks again. – reckface Feb 27 '13 at 10:06