none
SSRS System.Net.WebPermission problem

    Question

  • 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("https://www.youtube.com/")
    Return "https://www.google.pl/"
    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=2.0.0.0, 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
    and
    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
    http://support.microsoft.com/kb/842419
    But I still can't make it work.

    Thanks,


    Rafal




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

Answers

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

    Rafael


    Rafal




    • 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