Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8695553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:03:59+00:00 2026-06-13T01:03:59+00:00

I have tried a diverse amount of methods this is my latest method which

  • 0

I have tried a diverse amount of methods this is my latest method which I have tried to not fire the error but to no avail I still get the FileIOPermission error

The Full error is

Request for the permission of type ‘System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’ failed

The code I am using is the below

    Dim permissions As New Security.PermissionSet(Security.Permissions.PermissionState.None)
    permissions.AddPermission(New Security.Permissions.FileIOPermission(Security.Permissions.PermissionState.Unrestricted))
    permissions.AddPermission(New Security.Permissions.SecurityPermission(Security.Permissions.SecurityPermissionFlag.Execution))
    permissions.AddPermission(New Security.Permissions.SecurityPermission(Security.Permissions.SecurityPermissionFlag.Assertion))
    permissions.Assert()
    ReportViewer1.LocalReport.SetBasePermissionsForSandboxAppDomain(permissions)

    Dim asm As Reflection.Assembly = Reflection.Assembly.Load("ReportingServiceUtils, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cca1b177d76f2036")
    Dim asm_name As Reflection.AssemblyName = asm.GetName()
    ReportViewer1.LocalReport.AddFullTrustModuleInSandboxAppDomain(New Security.Policy.StrongName(New Security.Permissions.StrongNamePublicKeyBlob(asm_name.GetPublicKeyToken()), asm_name.Name, asm_name.Version))

The Code being used in the dll is the below

Public Sub Add(ByVal group As String, ByVal groupCurrentPageNumber As String)
    Try
        If _GroupWithRunningMaxPageNumber.ContainsKey(group) Then
            _GroupWithRunningMaxPageNumber(group) = groupCurrentPageNumber
        Else
            If _GroupWithRunningMaxPageNumber.Count = 0 Then
                Dim fileName = "C:\Working Folder\ms-dot-net-report-viewer-group-pagenation\ReportingServiceUtils\test.xml"
                sw = New System.IO.StreamWriter(fileName, False)
                sw.WriteLine("<root>")
                sw.WriteLine("</root>")
                sw.Close()
                sw.Dispose()
            End If
            _GroupWithRunningMaxPageNumber.Add(group, groupCurrentPageNumber)
            sw.WriteLine("<Group  current='" & group & "' lastPage='" & CStr(groupCurrentPageNumber) & "'/>", 1, 1)
            sw.Close()
        End If
    Catch ex As Exception
        Throw ex
    End Try
End Sub

Does anyone see anything wrong with the below code

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:04:01+00:00Added an answer on June 13, 2026 at 1:04 am

    I have found the solution and it was quite funny when I did.
    The below 1 liner solves the problem of not being able to have file access from report.

    Dim auth As New System.Security.Permissions.FileIOPermission( System.Security.Permissions.PermissionState.Unrestricted)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried implementing this , but the extension methods are not working when
I have tried searching over the internet about this problem but not able to
Have tried to compile and run this program, but have received this error message
I have tried this but couldn't achieve. I used justifiedfieldmanager buy its for only
I have tried and tried to get this peice of code working but with
I have tried various link posted on SO,but not got reliable answer. Here is
I have tried a lot to get this done but I dont know how
I have tried multiple date formats, but still I get nil back: Thu May
I have tried multiple variations of the following code, but I still get the
I have tried stuff like =~ \[[A-Za-z0-9]+\] which I would expect would work but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.