المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : System.Security.SecurityException



C# Programming
06-20-2009, 01:51 AM
I have an application I made that simply gets the current directory using System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().******** goes up a directory level and then runs a file in that directory using System.Diagnostics.ProcessStartInfo and System.Diagnostics.Process.Start. The file works fine if I run it on my computer but if I put the file on a Shared Network Path I get the below error:

Unhandled Exception: System.Security.SecurityException: Request failed.

at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly a

sm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, Secur

ityAction action, Object demand, IPermission permThatFailed)

at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object ass

emblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle

rmh, SecurityAction action, Object demand, IPermission permThatFailed)

at System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet gran

ts, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Objec

t assemblyOrString, SecurityAction action, Boolean throwException)

at System.Security.CodeAccessSecurityEngine.CheckSetHelper(CompressedStack cs

, PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMet

hodHandle rmh, Assembly asm, SecurityAction action)

at Setup.Program.Main(String[] args)

The action that failed was:

LinkDemand

The type of the first permission that failed was:

System.Security.PermissionSet

The demand was for:





The granted set of the failing assembly was:





























The assembly or AppDomain that failed was:

Setup, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

The Zone of the assembly that failed was:

Intranet

The Url of the assembly that failed was:

file:///T:/ClientUpdate/Setup.exe

Any ideas on how to fix this?