Upgrade Aspose.PDF to Higher version - License setting is causing issue

Our company is presently trying to upgrade the version of Aspose.Pdf.dll used by our application. The previous version of Aspose.Pdf was version 9.8.0.0, and we are attempting to upgrade to version 18.2.0.0. The previous version worked correctly, but after upgrading to the new .dll, we are seeing an exception thrown by the SetLicense() method in Apose.Pdf. We are attempting to set the license using the following code:


using (var stream = assembly.GetManifestResourceStream(“TYLImagingTools.Aspose.Total.lic”))
{
var license = new Aspose.Pdf.License();
license.SetLicense(stream);
}

In version 18.2.0.0, when calling SetLicense, we receive a System.IO.FileNotFoundException, which is appended to the bottom of this ticket. Based on the assembly name in the exception, I can only assume that this is some sort of obfuscated name of a .dll that Aspose.Pdf.License or one of its dependencies is relying on internally. Knowing which actual .dll Aspose.Pdf is trying to load would be very useful in solving the problem. I should also mention that our application takes over and makes some changes to the way .dlls are loaded in .NET, which we assume may be related to the problem. I can also confirm that the license resource is being correctly loaded from the .dll, and the stream object above does contain the license file. The license validation code above also runs correctly in a test program, and printing works correctly. Please advise.

As an aside, we do have paid support, but I am currently having trouble tracking down the login info.

Exception Follows:

System.IO.FileNotFoundException
HResult=0x80070002
Message=Could not load file or assembly ‘zx_4f9c8c08e0764c1097f6cd285683115c, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. The system cannot find the file specified.
Source=mscorlib
StackTrace:
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 ​..(String )
at ​..()
at ​.(Object , ResolveEventArgs )
at System.AppDomain.OnResourceResolveEvent(RuntimeAssembly assembly, String resourceName)
at System.Reflection.RuntimeAssembly.GetResource(RuntimeAssembly assembly, String resourceName, UInt64& length, StackCrawlMarkHandle stackMark, Boolean skipSecurityCheck)
at System.Reflection.RuntimeAssembly.GetManifestResourceStream(String name, StackCrawlMark& stackMark, Boolean skipSecurityCheck)
at System.Reflection.RuntimeAssembly.GetManifestResourceStream(String name)
at .(Assembly , String )
at .()
at .(Stream )
at Aspose.Pdf.License.SetLicense(Stream stream)
at TYLImaging.TYLImagingTools.ActivateLicense() in C:\temp\gitinfra2017\infrastructure\Source\DocumentImaging\TYLImagingTools\TYLImagingTools.Printing.cs:line 452
at TYLImaging.TYLImagingTools.PrintPDFInternal(String siteID, Boolean displayPrintDialog) in C:\temp\gitinfra2017\infrastructure\Source\DocumentImaging\TYLImagingTools\TYLImagingTools.Printing.cs:line 361
at TYLImaging.TYLImagingTools.PrintCurrentFileInternal(String siteID, Boolean displayPrintDialog) in C:\temp\gitinfra2017\infrastructure\Source\DocumentImaging\TYLImagingTools\TYLImagingTools.Printing.cs:line 218
at TYLImaging.TYLImagingTools.PrintCurrentFile(String siteID, Boolean displayPrintDialog) in C:\temp\gitinfra2017\infrastructure\Source\DocumentImaging\TYLImagingTools\TYLImagingTools.Printing.cs:line 75
at TYLImagingControls.TYLViewer.PrintCurrentFile(String siteID, Boolean displayPrintDialog) in C:\temp\gitinfra2017\infrastructure\Source\DocumentImaging\TYLImagingControls\TYLViewer.xaml.cs:line 1423
at Views.Documents.ImagingViewer.EafImagingViewerContext.PrintCurrentDocument(String siteID, Boolean displayPrintDialog) in C:\Odyssey\TylerEAF\Views\Documents\Controls\ImagingViewer\EafImagingViewerContext.cs:line 559
at Views.Documents.Controls.ImagingViewerViewModel.OnButtonPressed(ImagingViewerButton pressedButton) in C:\Odyssey\TylerEAF\Views\Documents\Controls\Views\ImagingViewer\ImagingViewerViewModel.cs:line 6765
at Views.Documents.Controls.ImagingViewerState.OnButtonPressed(IShellCommand command) in C:\Odyssey\TylerEAF\Views\Documents\Controls\Views\ImagingViewer\State\ImagingViewerState.cs:line 276

@suvi_lampio_tylertech_com

We would like to share with you that it is hard to determine the reasons behind issue without replicating it on our end.

Would you please share some details about how you are deploying the DLLs. Please share steps to reproduce the issue so that we can test the scenario in our environment and address is accordingly. Also, please try using Aspose.PDF for .NET 20.7 at your side.

My understanding is that our application hooks into the .net runtime in such a way that it is solely responsible for loading .dlls. We have a certain folder in our application where all .dlls live, and when a .dll needs to be loaded, that is where the program will look, and it will dynamically load the .dll into memory. The GAC causes problems in our development process, so the application will not load .dlls from it. This suggests to me that if there are other .dlls that Aspose.Pdf relies on when SetLicense() is called, we need to know about those .dlls so that we can include them in the proper folder so that they will be loaded. Can you advise me as to any dependencies that Aspose.Pdf may have when SetLicense is called?

@suvi_lampio_tylertech_com

We would like to share with you that Aspose.PDF for .NET does not have any dependency on external DLLs which you should separately install. Furthermore, all internal components and used DLLs are already included in the final Package and they are obfuscated. As mentioned earlier, it is hard to determine the actual cause of the error without replicating the issue in our environment.

It would be helpful if you could please share some sample application contains the part where you are loading DLLs from a folder and which is able to reproduce the issue in our environment. We will investigate the scenario in detail and share our feedback with you.

PS: Would you also please try using Aspose.PDF for .NET 20.7 as it is latest version and we recommend to use it.

Is it possible for you to determine what .dll is causing the error based on the obfuscated .dll name from the exception? I will see about the feasibility of a demo program, and get back to you. I will also try the latest Aspose.

@suvi_lampio_tylertech_com

The stack trace information is encrypted and proper cause of the issue can only be determined by investigating the scenario in our environment with a sample application we requested for. Please take your time to prepare a demo application and share it with us. We will log an investigation ticket and share the ID with you.

Just an update - we are currently attempting to put together a stripped down shell of the application that will still showcase the error. It is just taking some time, since we have to strip out things like security and other dependencies. Hopefully I will have something positive to report in the next 2-3 days.

@suvi_lampio_tylertech_com

Sure. Please take your time and share the sample application as per your convenience. We will further proceed to assist you accordingly.

Hi, I’m another developer at Tyler Technologies, and I’ve created the sample application that showcases the error. It is a 20MB zip file and thus too large to email (it gets caught by our email filters). Could someone please send me an email at brian.devries@tylertech.com and I’ll email you back a link where you could download it? Because it contains proprietary info, we don’t want to post it publicly.

@contingencyplan

We apologize for the delayed response.

Please share the link in a private message which is secure. You can send it by clicking over username and pressing Blue Message Button.