We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Unable to activate license in SQL ClrLib

Hello,

I’ve tried to use Aspose.PDF in C# (.NET). It is installed via NuGet and doesn’t seem to work correctly. The license is a “Developer OEM”-license, which is valid for Aspose.Total for .NET. The problem is, that I’m trying to integrate Aspose.PDF into a ClrLib for SQL.
Sadly, I am not able to license any of your Products using the .setLicense() method. I have tried to license Aspose.PDF, Aspose.Words and Aspose.Email, in case there is a problem with Aspose.PDF. But all of those kept throwing an exception.

The different methods to license it, such as using the path, a stream with the file content or embedding it via an embedded resource, are all not functional and causing exceptions.

One of the exceptions, which throws when I try to license it with a path to the license file, is the following:

System.IO.FileNotFoundException: Could not load file or assembly ‘zx_4cc31c45571f455c8c5e84b20a1f006f, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. The system cannot find the file specified.

System.IO.FileNotFoundException:

at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)

at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)

at System.Reflection.Assembly.Load(String assemblyString)

at #=qjJ7vXV0PACE5SGNwURrL8jFrEkVHK996y0nwcbO5BVs=.#=zL_J$AyA6Om08G0iyalt_HNPn8Q25.#=zU9cYMZTMBuqm87T9ZL_d60Gkkegj(String #=z5n9d5LsAQNDCfzC0cvlsy0IW3nxO)

at #=qjJ7vXV0PACE5SGNwURrL8jFrEkVHK996y0nwcbO5BVs=.#=zL_J$AyA6Om08G0iyalt_HNPn8Q25.#=zbyvOmo$Pxa6KY501ku4d$tUu_$Ir()

at #=qjJ7vXV0PACE5SGNwURrL8jFrEkVHK996y0nwcbO5BVs=.#=z6w6b8NYAZihFaHGLoKhx5HKpsMHN(Object #=zlaJoHs_zU0WSNwAaeHvApZPZd8d2, ResolveEventArgs #=zbx2j0dBaZ1vD1BbHhPd7NZM=)

at System.AppDomain.OnResourceResolveEvent(RuntimeAssembly assembly, String resourceName)

at System.Reflection.RuntimeAssembly.GetResource(RuntimeAssembly assembly, String resourceName, UInt64& length, StackCrawlMarkHandle stackMark, Boolean skipSecurityCheck)…

Is there anything I could check or change to make sure, that it runs successfully?

Best regards

@Programmierung

Thank you for contacting support.

It looks like there is some problem while resolving the dependencies for Aspose APIs in your environment as the stack trace does not show Aspose APIs as source of any exception. Would you please elaborate if you are facing the problem while setting license or if it occurs if you work with any other class of the APIs.

In case other features are working fine then please try executing below code snippet in your environment and then share generated PDF document with us.

Aspose.Pdf.Document document = new Aspose.Pdf.Document();
document.Pages.Add();
document.Save("Test_19.3.pdf");

If this code does not execute either then you may resolve the problem by searching over the internet, and feel free to contact us if you face any problem specific to Aspose APIs.

Thank you for answering so quickly.
The problem occurs on other API calls, such as .Process, as well. I create the Aspose assemblies in our SQL server without any errors, so that shouldn’t be a problem. See here: Aspose assembly list (6.9 KB)
Another thing I wondered about is the amount of dll’s I had to specifically create an assembly for. Those were around 10, which sounded odd to me.

@Programmierung

We have investigated the scenario further and found it to be reported already. We have recorded your concerns as well and the ticket PDFNET-42703 has been linked with this thread so that you may be notified as soon as it is resolved.

About number of APIs, we are in the process of building single DLL for Aspose.Total for .NET which will include all APIs then you would not need to create assemblies one by one.

Okay, got that.
I can’t wait that long, which is why I have to find a solution to that soon. Do you have a rough ETA for a solution regarding this problem?
I would really appreciate it if you could message me when the single DLL for Aspose.Total is released. Thanks!

@Programmierung

We are afraid that an ETA may not be available before the ticket is investigated. However, we have recorded your concerns and will try to schedule it soon. We will notify you as soon as any update will be available.

Moreover, we will let you know here in this thread once some information will be available in this regard.

So, after testing around for several days, I came a bit further.
The Aspose.PDF API works now, but the weird thing is, that I have to run that method once, before it works. When I try to run that method call for the first time, I only get that error I described above. After that, the Aspose.PDF API works fine.

@Programmierung

Thank you for getting back to us.

We have recorded your comments and will be able to share further findings once it is scheduled for investigations. We appreciate your patience and comprehension in this regard.