1

Resolved

Unhandled Exception: System.Security.SecurityException

description

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=2.0.0.0, 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

comments

jaspersmith wrote Jul 4, 2008 at 12:16 PM

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.