Results 1 to 4 of 4

Thread: Unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2005
    Posts
    200

    Exclamation Unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib

    I am getting the following error message when trying to run a program over the network:


    "An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll"

    "Additional information: Request for the permission of type System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed."

    First, I am not the author of the code. Second, I have Admin privilges to all network drives and am a Admin on MyComputer. I have googled the error to look for problems, and most said to change settings in the .NET Framework for .NET 1.1. I did; however, I still get the same error.

    VB Code:
    1. Private Sub cmdZone_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdZone.Click
    2.         [B]odlgFreight.FileName = ""[/B]
    3.         Try
    4.             If CheckCarrier() = True Then
    5.                 odlgFreight.Filter = "Text files (*.txt; *.csv)|*.txt;*.csv"
    6.                 If odlgFreight.ShowDialog() = DialogResult.OK Then
    7.                     If odlgFreight.CheckFileExists = True Then
    8.                         Try
    9.                             CreateZones(odlgFreight.FileName, Me.cboShipType.SelectedItem, Me.cboCarrier.SelectedItem)
    10.                         Catch ex As Exception
    11.                             MessageBox.Show(ex.Message)
    12.                         End Try
    13.                         txtLog.Text = txtLog.Text & Now() & ": " & cboCarrier.SelectedItem & " Zones Created" & vbNewLine
    14.                     End If
    15.                 Else
    16.                     MessageBox.Show("Operation cancelled or other error", "File Selection", MessageBoxButtons.OK, MessageBoxIcon.Error)
    17.                 End If
    18.             End If
    19.         Catch ex As Exception
    20.             MessageBox.Show(ex.Message)
    21.  
    22.         End Try
    23.  
    24.     End Sub

    Nenio foriras ĝis ĝi havas instru ni kiu ni devas scii.

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Sep 2005
    Posts
    200

    Re: Unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib

    The executable is on a Network drive that I am an Administrator on. And the bold line of the code is where the error is thrown. Thank you for your time and help.

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib

    Go into your control panel -> administrative tools -> Microsoft .NET Framework 1.1 Configuration -> Runtime Security Policy

    Then click on the "Adjust Zone Security" link on the right.

    Click next when the first screen pops up, then on the second, click "Local Intranet" and increase its trust level to full trust.

    See if that makes a difference.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2005
    Posts
    200

    Re: Unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib

    Yeah, that's actually one of the things I have already tried. I just looked again, and it is still giving me that error

    Nenio foriras ĝis ĝi havas instru ni kiu ni devas scii.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width