That assembly does not allow partially trusted callers
Posted by Bill Williams, Last modified by Andy Williams on 26 July 2007 12:37 AM

When deploying ASP.NET 2.0 Web applications to Indichosts.net Hosting
environmment you may run into the following error:

SecurityException: That assembly does not allow partially trusted callers.

Your application is unable to call strong named assemblies that are not
annotated with AllowPartiallyTrustedCallersAttribute (APTCA). Without
APTCA, strong named assemblies issue a demand for full trust, which will
fail when the demand reaches your partial-trust Web application. In Indichosts.net,
ASP.NET 2.0 applications are configured to run in a custom
trust level based on the Medium Trust Level.

To solve this issue mark your assemblies with the attribute
AllowPartiallyTrustedCallersAttribute, the attribute should be declared
at the assembly level (usually declared at Assemblyinfo.cs or
Assemblyinfo.vb).

An example of the declaration in C# is :

[assembly:AllowPartiallyTrustedCallers]

and in Visual Basic is :

<assembly:AllowPartiallyTrustedCallers>
(283 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).