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