How do I change my library to allow partially trusted callers?
I get the following error:
Server Error in '/' Application.
Description: The application attempted
to perform an operation not allowed by
the security policy. To grant this
application the required permission
please contact your system
administrator or change the
application's trust level in the
That assembly does not allow partially
Source Error: [No relevant source
Source File: App_Web_kzj7vfkn.2.cs
Assuming you have access to the sources of your library.
A pretty good and detailed explanation is given here Also read the links at the bottom to get a better understanding.
There is a possibility that not your assembly is the problem but you are calling another assembly that does not allow partially trusted callers. At runtime you can use fuslogvw to find which assembly is giving you the problems. If this is the problem and you have the sources of this assembly you need to also apply the [assembly:AllowPartiallyTrustedCallers] attribute to that assembly, if you don't have the sources the only option I know of is to replace the troublesome library.