Assembly does not allow partially trusted caller

Viewed 59980

How do I change my library to allow partially trusted callers?

I get the following error:

Server Error in '/' Application.

Security Exception

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 configuration file.

Exception Details: System.Security.SecurityException: That assembly does not allow partially trusted callers.

Source Error: [No relevant source lines]

Source File: App_Web_kzj7vfkn.2.cs
Line: 0

Edit

After some more looking at the problem it seems like it's System.Web.UI.ClientScriptManager that causes the problem

6 Answers

Here's yet another possible solution, depending on the library you're using and your setup: Make sure you're running your program from a "local" drive.

I ran into this error message when running my program in a VM in a folder shared between host and guest OS, with the library dll present beside the exe. Copying the folder to a drive local to the guest OS fixed the issue.

It makes sense that this would cause a trust issue, but a more helpful error message would be nice.

Related