Questions about permissions when running from network share RRS feed

  • Question

  • Our .NET 2.0 application requires FullTrust to run as it uses unmanaged code. Currently our application starts up if run from a network share, but it fails at some point later with a SecurityException 

    I would like it to not run at all if it doesn't have FullTrust. So I tried adding the following attribute to the exe assembly:

    [assembly: PermissionSet(SecurityAction.RequestMinimum, Name = "FullTrust")]

    I expected that when I tried to run the application from a network share, it would fail to load and I would get an error message. But it made no difference. Why is this? I tried running it by navigating to it in Explorer, and by using a shortcut. Is it because I have .NET 3.5 SP1 installed, or would this make no difference to a .NET 2.0 assembly?

    There are multiple assemblies in our application (all installed in the application directory), and at some point when running from a network share, one of these assemblies must be Partially Trusted, because I get a Security Exception 'That assembly does not allow Partially Trusted Callers' when System.Configuration.dll is called. If my main application is somehow getting FullTrust, at what point would we expect an assembly it calls to have the normal LocalIntranet Zone permission set? I have tried making a test application in which one assembly calls another in the same directory, and they both Request.Minimum FullTrust, but there are no problems running from a network share.


    Thursday, April 15, 2010 3:13 AM


All replies