How to solve System.Security.SecurityException: That assembly does not allow partially trusted callers.

3:21:00 am 1 Comments

Recently I found myself in another shared hosting problem. After reading several solutions on these problem none of them work. Most specifically I've tried to modify the AssemblyInfo.cs. I've added the following attribute:

[assembly: AllowPartiallyTrustedCallers]

Then I set my .NET Trust Level to Medium level, you can change it by opening IIS Information Service. But still I have the same error. Looking for solution and testing locally I found out that setting my my >NET Trust Level to Full internal resolved the issue. So I found of a way on how to override this setting in web.config and found it (after system.web add the ff line):

<system.web>
    <trust level="Full" originurl=""></trust>
</system.web>

And it worked perfectly.

1 comments: