SSRS System.Net.WebPermission problem


  • Hi,

    In my SSRS report in code property I created an extremely simple function as shown below.

    Public Function getFirstLink(searchedStr As String) As String
    Dim webClient As New System.Net.WebClient
    Dim loadedPage As String = webClient.DownloadString("")
    Return ""
    End Function

    Obviously id doesn't work because of the security issues. I get an error: Request for the permission of type 'System.Net.WebPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. Can anyone tell me what to get rid of it? I'm a noob and honestly I don't give a sh... about security. I just want this stupid code work then I will worry about the rest. 

    Not that I'm that lazy and didn't try. I know that I have to modify 
    C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\rssrvpolicy.config
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\RSPreviewPolicy.config
    and use 
    Microsoft .NET Framework 2.0 Configuration tool
    to generate sample sections that have to be paste there as it is written here
    But I still can't make it work.



    • Edited by Rafcio666 Monday, May 20, 2013 1:54 PM
    Sunday, May 19, 2013 6:25 PM


  • OK,

    Forget it. I gave up and just set "FullTrust" in "Report_Expressions_Default_Permissions" code group. I guess this is the only way if I don't want to create my own dll.

    Best wishes,



    • Edited by Rafcio666 Tuesday, May 21, 2013 5:33 AM
    • Marked as answer by Rafcio666 Sunday, May 26, 2013 4:45 PM
    Tuesday, May 21, 2013 5:09 AM