Strange error with DoConvert

I get this strange exception when I attempt to run the DoConvert method of the pdfkit. This is in Visual Studio 2010, .net framework 4.0, pdfkit version 4.6:

Attempt by security transparent method 'xeb116a323308e2f7.xac95a1ca7d28b25a.xcec56c0fd092d878()' to access security critical method 'System.Management.ManagementObjectSearcher..ctor(System.String)' failed.

Assembly 'Aspose.Pdf.Kit, Version=, Culture=neutral, PublicKeyToken=ae9e610db67fc2c1' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model. Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.

I tried adding

<Assembly: SecurityRules(Security.SecurityRuleSet.Level1)>

To my app, but that didn't help. Any help would be appreciated.

Hi Bob,

Can you please share the sample PDF file and the code snippet you’re using at your end? Also, please share the name of the Windows OS you’re working on. We’ll test the issue at our end and you’ll be updated accordingly.

We’re sorry for the inconvenience.

Windows XP (32bit) is the OS. Here is the code, and the pdf is attached. But it happens with any pdf. I have no more code after the DoConvert call because that's where the error occurs.

Imports Aspose.Pdf.Kit
Imports System.IO

Public Class Form1
Private lic As New License
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim converter As New PdfConverter
End Sub
End Class

Hi Bob,

I have tested this issue on Windows XP using the latest version, but couldn’t notice any problem. The file was successfully converted to images. Please download the latest version and try at your end. If you still find the problem then please share a sample project which can help us reproduce this issue at our end.

We’re sorry for the inconvenience.

I downloaded the pdfkit files yesterday so I assume I have the latest. So you created a sample project in Visual Studio 2010 using .net framework 4.0? Can you provide me with your code?

Hi Bob,

I have reproduced this issue at my end using .NET Framework 4.0; previously, I was wrongly using .NET Framework 2.0. I have logged this issue as PDFKITNET-18495 in our issue tracking system. Our team will investigate this issue and you’ll be updated via this forum thread once it is resolved.

We’re sorry for the inconvenience.

We are gettig the same error message in our application, using the latest build of pdf.kit (ver 4.9.0) with .NET framework 4.0. It is not consistent.

Has this issue been resolved? How can we check the status of PDFKITNET-18495 ?

Hi Dag,

I’m unable to reproduce this issue using version 4.9.0. Can you please make sure that you’re using 4.9.0? If you still find the same problem with version 4.9.0 then please share a small sample application along with the sample PDF file, which can help us reproduce this issue at our end.

We’re sorry for the inconvenience and looking forward to help you out.