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:
Private Sub cmdZone_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdZone.Click
[B]odlgFreight.FileName = ""[/B]
Try
If CheckCarrier() = True Then
odlgFreight.Filter = "Text files (*.txt; *.csv)|*.txt;*.csv"
If odlgFreight.ShowDialog() = DialogResult.OK Then
If odlgFreight.CheckFileExists = True Then
Try
CreateZones(odlgFreight.FileName, Me.cboShipType.SelectedItem, Me.cboCarrier.SelectedItem)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
txtLog.Text = txtLog.Text & Now() & ": " & cboCarrier.SelectedItem & " Zones Created" & vbNewLine
End If
Else
MessageBox.Show("Operation cancelled or other error", "File Selection", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
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.
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.
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