Unhandled Exception: System.Security.SecurityException


When run from a network share it generates an exception:
P:> expressmaint -?
Unhandled Exception: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
where "P:" is a network share.
The work around is not to run it from a network share but this is not ideal for us.

file attachments


jaspersmith wrote Jul 4, 2008 at 11:16 AM

This is a .NET security issue not anything to do with the tool. By default, applications run from shares or UNC paths have limited permissions. You need to configure .NET to trust the assembly location. You can do this using the .NET 2.0 Configuration tool (Start>Programs>administrative Tools>.NET Framework 2.0 configuration. Expand My Computer and browse to Machine>Code Groups>All_Code. Right click and select New. Give it a name e.g. ExpressMaint and click Next. Select URL as the Condition Type and enter P:\expressmaint.exe as the URL and click Next. Accept the default on the next page (Full Trust) and click Next and then Finish. I have attached a picture to help clarify this.

wrote Jul 4, 2008 at 11:16 AM

wrote Jul 4, 2008 at 11:16 AM

wrote Feb 21, 2013 at 11:09 PM

wrote May 16, 2013 at 11:03 AM

wrote May 16, 2013 at 11:03 AM

wrote Jun 14, 2013 at 7:27 AM