Strong named assembly does not allow partially trusted callers

Many of the projects I work on run a number of shared libraries that I have installed in the GAC. As you know, you need to create strong-named assemblies to put them in the GAC. All assemblies you put in the GAC get Full Trust permissions automatically, as stated in the documentation.

"By default, strong-named shared libraries perform an implicit LinkDemand for full trust automatically, without the library writer having to do anything"

When you run a strong-named shared library in your project from the bin directory in a less that Full Trust environment you can run into problems. You get a security exception due to the implicit LinkDemand.

Security Exception: "That assembly does not allow partially trusted callers."

There is a good explanination on using libraries from partially trusted code in the .NET documenttation for the reason why you get the error and what the solution is. 

Solution

As lonf as your library does not require Full Trust to run all you need to do is add the AllowPartiallyTrustedCallersAttribute to your assembly declaration and recompile your library. I have recently applied this to the SWFObject.Net project to resolve this issue.