3

I am getting security exception while using itextsharp.dll in rackspace cloud site. Following is the exception:

[SecurityException: That assembly does not allow partially trusted callers.]

Can anyone help on this?

Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592
Dinu
  • 33
  • 6

1 Answers1

3

To ensure that your assemblies will work in a medium trusted environment, you need to give them a strong name and mark them with an attribute that tells the .NET security runtime to allow the code.

To allow partially trusted callers from your code, add the following attribute to the assembly’s AssemblyInfo.cs file:

[assembly: AllowPartiallyTrustedCallers]

You will also need to ensure that the file references the System.Security namespace.

In addition, you will also need to give your assembly a strong name by signing the assembly though the project properties dialog.

Prem Singh
  • 1,035
  • 3
  • 13
  • 31