Written on August 7th, 2010 at 2:25 pm by

5 Comments

We were using itextsharp for pdf generation on the fly in a .net web application. Everything was working fine in our local server. But when we uploaded to the production server, we got an exception with the following details:

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

After searching we found that itextsharp dll is compiled to run in full trust. So we found the following solution.
We think it will be helpful for people deploying applications using itextsharp in hosted environments (like godaddy in our case):


1. You should download the source code for itextsharp.
2. Then you have to modify the AssemblyInfo.cs file by adding these references and attribute:
using System.Security;
using System.Security.Permissions;
[assembly: AllowPartiallyTrustedCallers]

3. You should recompile itextsharp and copy again in your bin directory (depending on the way you use it).


VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)
, ,

5 Responses to “itextsharp: That assembly does not allow partially trusted callers”


  1. tsanko

    1 year ago

    Wonderful ..thanks a lot for posting a good informitive blog

    VA:F [1.9.17_1161]
    Rating: 0 (from 0 votes)

  2. Panos

    1 year ago

    Found it interesting

    VA:F [1.9.17_1161]
    Rating: +1 (from 1 vote)

  3. Jorge

    1 year ago

    How can I re-copile itexshar?

    Thank you

    VA:F [1.9.17_1161]
    Rating: 0 (from 0 votes)

  4. point

    1 year ago

    @Jorge: You should download the source code for itextsharp, open it with visual studio and compile it

    VN:F [1.9.17_1161]
    Rating: 0 (from 0 votes)

  5. Pedrero

    1 month ago

    Thanks man, works like a charm =D

    VA:F [1.9.17_1161]
    Rating: 0 (from 0 votes)

Leave a Reply