I have an ActiveX control in my web page to print out bills. It works fine on local but when I try in remote server, I can’t print out, it gives me this error.
System.Security.SecurityException: Request for the permission of type ‘System.Drawing.Printing.PrintingPermission, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ failed.
I found the answer, here steps are
1) Add your site to Trusted Zone
2) Then type these commands in command prompt. If you use 64-bit MSIE please use the both of these commands. I use .NET Framework 2.0, if you use other version please check and change the path of caspol.exe tool
C:\Windows\Microsoft.NET\Framework\v2.0.50727\caspol.exe -machine -quiet -addgroup Trusted_Zone -site ip_address_or_site FullTrust -name give_a_name_to_your_exception -description “Give a description to your exception”
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\caspol.exe -machine -quiet -addgroup Trusted_Zone -site ip_address_or_site FullTrust -name give_a_name_to_your_exception -description “Give a description to your exception”