This is a migrated thread and some comments may be shown as answers.

Medium Trust with 2009 Q2 SP1

5 Answers 109 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John Mathis
Top achievements
Rank 1
John Mathis asked on 09 Sep 2009, 08:29 PM
I just updated to 3.1.9.807 and I'm having trouble related to running under medium trust.

The problem is manifested with the following message:
The http handler needed by the Report Viewer has not been registered in the application's web.config file.  Add <add verb="*" path="Telerik.ReportViewer.axd" type = "Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=3.1.9.807, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" /> to the system.web/httpHandlers section of the configuration file.

This is the fairly standard message that means the assembly is not properly configured in web.config.  I tried copying the tag above into the appropriate place, but found it was already there.

Now the medium trust connection: I switched back to full trust, and things worked just fine.  This problem only occurs under medium trust.  Please advise.

Regards,
John

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 10 Sep 2009, 06:55 AM
Hello John,

The error message you've received appears when the http handler of the web viewer is not present in the web config or is incorrect. Although the error message urges you to add the handler to the system.web/httpHandlers section only, if you're deploying to IIS7, the handler should be registered in one more place - system.webServer/handlers section which is specific for this IIS version:

<system.webServer>
        <handlers>
            <add name="Telerik.ReportViewer.axd_*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=3.1.9.807, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" path="Telerik.ReportViewer.axd" verb="*"/>
        </handlers>
        <validation validateIntegratedModeConfiguration="false"/>
    </system.webServer>

Also if IIS7 is setup to work in integrated mode, please add the following attribute at the end of the Telerik.ReportViewer handler:

preCondition="integratedMode,runtimeVersionv2.0" i.e.

<system.webServer>
        <handlers>
            <add name="Telerik.ReportViewer.axd_*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=3.1.9.807, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" path="Telerik.ReportViewer.axd" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/>
        </handlers>
        <validation validateIntegratedModeConfiguration="false"/>
    </system.webServer>

If you've placed the viewer on the .aspx page from the VS toolbar or switched the page to designer view, the viewer would automatically add the handler to both sections, but if you've added it manually, you would need to take care of both.
Also if your host provider is GoDaddy, have in mind that they do not provide default medium trust, but a modified one (namely ReflectionPermission). So basically if you have assigned a report to the ReportViewer through the designer i.e.:

   <telerik:ReportViewer ID="ReportViewer1" runat="server" Report="ClassLibrary1.Report5, ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
   </telerik:ReportViewer>

you would receive an exception. Fortunately the workaround is easy - just set the report programmatically:

Dim rpt As Telerik.Reporting.Report = New MyReport1()
ReportViewer1.Report = rpt

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
John Mathis
Top achievements
Rank 1
answered on 10 Sep 2009, 02:00 PM
Thanks for your reply.  I added the system.webServer section as suggested, but saw no change in behavior.

Here are the relevant sections copied from my web.config file:

<

 

system.webServer>

 

 

 <

 

handlers>

 

 

 <

 

add name="Telerik.ReportViewer.axd_*" path="Telerik.ReportViewer.axd" verb="*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=3.1.9.807, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" preCondition="integratedMode,runtimeVersionv2.0" />

 

 

 </

 

handlers>

 

 

 <

 

validation validateIntegratedModeConfiguration="false" />

 

 

 </

 

system.webServer>
 <system.web>

 

 

 [...]

 

 

 

 

<

httpHandlers>

 

 

<add path="Telerik.ReportViewer.axd" verb="*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=3.1.9.807, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" validate="true" />
 </httpHandlers>

 

 

 

 [...]

 

</system.web>

The application is hosted at Rackspace using a modified medium trust. Read more here if you like; http://help.rackspacecloud.com/article.php?id=383.

We are assigning the report to the reportviewer in the code behind.

Thanks for your help.

John

 

 

0
Jason
Top achievements
Rank 1
answered on 14 Sep 2009, 04:53 AM
I am using Godaddy and I am running reporting also.
I have the changes on the server but I am still getting the same error.
0
Accepted
Chavdar
Telerik team
answered on 14 Sep 2009, 12:53 PM
Hi guys,

I believe we have found the reason for the problem. As in medium trust we cannot use the regular way of detecting the http handler because of the security permissions we use a different approach. However, when the viewer is in a page which is placed in an inner folder of the web application the web.config file is not properly detected and thus the http handler is not found. We will log this issue and will fix it accordingly. Meanwhile, to solve the problem in your applications you have to put the attached web.config into the inner folder where the page with the viewer is. Be careful not to override your original web.config in the root folder as this one contains only the http handler's registration.

Hope this helps. Let me know whether everything works property after applying the suggestion.

Sincerely yours,
Chavdar
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
John Mathis
Top achievements
Rank 1
answered on 05 Oct 2009, 02:57 PM
Thank you!  This does resolve the issue described above.  Sorry for the late reply.

John
Tags
General Discussions
Asked by
John Mathis
Top achievements
Rank 1
Answers by
Steve
Telerik team
John Mathis
Top achievements
Rank 1
Jason
Top achievements
Rank 1
Chavdar
Telerik team
Share this question
or