.net - PermissionSet - where are an assembly's security restrictions set? -


i have inherited solution contains class library method decorated with:

[permissionset(securityaction.assert, name = "fulltrust")] 

the attribute required, because if comment out attribute, method throws following exception:

system.security.securityexception: request permission of type 'system.security.permissions.fileiopermission, mscorlib, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089' failed.

as far can see, executable references assembly running in full trust, beccause when in executable's app.manifest, can see:

<requestedexecutionlevel level="asinvoker" uiaccess="false" /> 

as run visual studio administrator, assume hitting debug run executable in administrator mode, should have full permissions (though might misunderstanding entirely).

the assemblyinfo of library doesn't seem have interesting security restrictions.

so can't see why library running @ lower trust level start with. can tell me possible places should see restrictive security policy being set?

(it might worth noting project designed under .net 3.5, job upgrade work on 4.0 (on runs). understand security model has changed in latest version.)

ok found answer. security restrictions on appdomain assembly loaded. thought assembly called statically, turns out loaded new appdomain @ runtime.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -