I have an app written in C# that lies on a network share. When I run it from a local drive, everything works fine. When I start it from the remote share, calls like
try { System.Reflection.Assembly.GetExecutingAssembly(); System.IO.Directory.GetCurrentDirectory(); }
throw a SecurityException ‘Request failed’.
What causes this, what is the difference between an app that is started locally and one that is started from a remote location?
This is due to CAS; code started from the local machine has much more trust than code in the intranet, which in turn has more trust that code from the internet.
IIRC, with the latest SP (3.5SP1?) if you have mapped the share (i.e. as F:) it is trusted; otherwise you will need to either:
a: apply a caspol change to all clients (yeuck)
b: use ClickOnce to deploy the app, and run the .application instead (yay!)
The point is that ClickOnce allows you to sign the app and state your security policy (even if you demand full trust).