SecurityException error when an application starts from a remote folder

I have an application written in C # that is located on a network share. When I run it from a local drive, everything works fine. When I launch it from remote access, calls like

try
{
    System.Reflection.Assembly.GetExecutingAssembly();
    System.IO.Directory.GetCurrentDirectory();
}

throw a SecurityException 'Request' request.

What causes this, what is the difference between an application that runs locally and one that starts from a remote location?

+3
source share
3 answers

This is due to CAS ; code running from the local computer has much more trust than code on the intranet, which in turn trusts this code more from the Internet.

IIRC, SP (3.5SP1?), (.. F:) ; :

a: caspol (yeuck)

b: ClickOnce, , .application(yay!)

, ClickOnce ( ).

+5

, .

, .NET Access Access Security.

http://msdn.microsoft.com/en-us/library/aa302422.aspx

, .NET Framework Configuration, RunTime, , , LocalIntranet, , "", "" "FullTrust".

( , ) .

. , .NET Access Access Security, .

, , , . "" , .

+2

They have changed this to some extent .Net Framework 3.5 SP1. See .NET 3.5 SP1 Launches Managed Applications from Network Resources

+1
source

Source: https://habr.com/ru/post/1697972/


All Articles