Encrypted Aspose.PDF assembly name

Hello,

I am currently evaluating Aspose.PDF to see if it suits my needs to buy a license.

At the time I try to load the Assembly (Aspose.PDF.dll) on AppDomain.CurrentDomain I see that the
System.Reflection.Assembly.FullName is encrypted

{zx_8e4184d610194a3a9fea2dbec7aeb9f9, Version=21.2.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63}.

This, causes an infinite loop of loading attempts that leads into an overflow exception. However, If I hardcode the assemply name into

{Aspose.PDF, Version=21.2.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63}
it works.

My question is, how could I avoid getting the assembly name encrypted in my project? (This happens with any Aspose.PDF version but with Aspose.Words it seems that it works fine).

Thanks

@fnikolopoulos

I have tried using Aspose.PDF for NET 21.3 on my end and did not observe any issue. For your reference, I have attached the image too. Can you please share the working sample Visual Studio project exhibiting the issue on your end and we will try reproduce the same on our end on the basis of that.
image.png (262.8 KB)

I think it has to do with the shadow copying. It tries to load Aspose.PDF.dll from

/AppData/Local/Temp/Temporary ASP.NET Files/vs/…

The dll name is correct there but when I debug the code tries to retrieve a file zx_8e4184d610194a3a9fea2dbec7aeb9f9

Unfortunatelly I cannot share my company’s project. I found the same issue on stackoverflow

regards

@fnikolopoulos

Thanks for sharing more details.

We have tested the scenario in both console and web applications. We were not able to notice this issue that you are facing. We totally understand that you could not share your main project. However, please try to share some steps which we can perform to replicate the issue. Are you trying to use the API in Classic ASP? Please try to register the assembly in GAC if this is the case. In case issue still persists, please share some details on how it can be replicated at our end. We will further proceed to assist you accordingly.

Thanks for you reply,

I tried to register the dll in GAC but the issue still persists.

The moment I try to use the doc.Save(filepath) the method AssemblyLoad in GetContainer is invoked

public static IWindsorContainer GetContaier(out IWindsorContainer container)
{
_container = new WindsorContainer();
_container.Install(FromAssembly.This());
AppDomain.CurrentDomain.AssemblyLoad += (sender, args) =>
{
try{
_container.Install(FromAssembly.Named(args.LoadedAssembly.FullName));
}
catch
{
}
};
}

and the args.LoadedAssembly.FullName is equal to

zx_8e4184d610194a3a9fea2dbec7aeb9f9, Version=21.2.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63

where as the file name in args.LoadedAssembly.CodeBase is
/AppData/Local/Temp/Temporary/ASP.NET Files/vs/…/Aspose.PDF.DLL

if I check the AppDomain.CurrentDomain.GetAssemblies() I get a list of assemblies where I can see the Aspose.PDF.dll with name {Aspose.PDF, Version=21.2.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63} and CodeBase /myproject/bin/Aspose.PDF.DLL

I have no idea what is going on and when I try to use the save method of Aspose.Words.Document nothing of the above happens since the flow does not get into the GetContainer method.

Anywhere in my code that I use aspose if I try to use:
AppDomain.CurrentDomain.AssemblyLoad += (sender, args) => { };
the name of the assembly in args.LoadedAssembly.FullName is zx_8e4184d610194a3a9fea2dbec7aeb9f9 and not Aspose.PDF

regards

@fnikolopoulos

Please share your complete environment details e.g. OS Name and Version, Application Type, etc. Also, please share a minimal/narrowed down code sample which is able to reproduce the same issue that you are facing. We will further investigate the reasons behind it and share our feedback with you.

Hello thanks for your quick reply!
I am running VS2019 enterprise on Windows 10 Home 64 bit.
I see this problem in a simple console application running .Net Framework 4.7.2, Aspose.Pdf version 21.4.0.0

image.png (61.8 KB)

as you can see myVar for every debug cycle is:
“zx_a6f4484774a9446db09e39bf09584858, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”
“zx_3eb609884b7a4a78a811c16278004fe2, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”
“zx_f401e0d6379845759b7fd29ef1392266, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”
“zx_126034efd81a4b07b3e73cd31e3e02ac, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”
“zx_114818bd514a421fbc3aa4547a6c1f21, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”
“zx_bf4565ab0e1a4482b00701902968f7fb, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”
“zx_cf0c7dae8f0e43de9049f5a64ff008ca, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”
“zx_68433363dfcf425c809dbc3b756e8640, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”
“zx_e8dd43a3cba2493ea7da9100f2128aad, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”
“zx_06f7cf6bb72d4c0b97ec5301a7576d5e, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”
“zx_5b0f1533156d4a23a5a70f3c368ef98b, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”
“zx_1ba6a95bdd414bdcb25ca1cffaf0e9d6, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”
“zx_d1a99d14f11a421db77bad52e796a5f1, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”
“zx_e64482285879478392aafa3f9c9f9269, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”
“zx_e7dfcaeb7835466a9dc81d39094ef42c, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”
“zx_a5efd92cbe6a4309a13121e7d0c4cc33, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”

and I cannot understand why it is not “Aspose.PDF, Version=21.4.0.0, Culture=neutral, PublicKeyToken=f0262d67fe233d63”

A piece of code that can show that is the following console application running on .net 4.7.2 by debugging the myVar variable.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Aspose.Pdf;

namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
using (var doc = new Document(@“C:\My_Files\Documents\tmp\output.pdf”))
{
AppDomain.CurrentDomain.AssemblyLoad += (sender, ar) =>
{
var myVar = ar.LoadedAssembly.FullName;
};

            doc.Save(@"C:\My_Files\Documents\tmp\output2.pdf");
        }
    }
}

}

It is difficult to extract a piece of code showing that in my real project since it is huge and I have not a complete undestanding to extract a stand alone part of code.

In the first place I need to understand what are these strange names and if there is any way of obtaining “Aspose.Pdf” instead of “zx_a6f4484774a9446db09e39bf09584858”

regards

@fnikolopoulos

We are sorry for your inconvenience as we are unable to locally reproduce the issue on our end. I have created a ticket with PDFNET-49768 in our issue tracking system to further investigate this issue on our end. We request for your patience and will share the feedback with you as soon as the issue will be addressed.