I have a .NET Core 2.2 project (WebAPI) with some .NET Framework 4.6 projects referenced. One of the 4.6 project installed Aspose.pdf from NuGet with License in there.
Recently I upgrade the WebAPI project to .NET 6, everything works fine until I test the Aspose project function. It’s pop-up exception on set license statement:
new Aspose.Pdf.License().SetLicense("Aspose.Total.655.lic");
Exception log: System.TypeLoadException: Could not load type 'System.Runtime.Remoting.RemotingServices' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Aspose.PDF for .NET 22.9 has support for .NET 6.0. Can you please try to create a new sample Console Application targeting .NET 6.0 and test there. If issue still persists, please share that application with us so that we can use it to replicate the issue and address it accordingly.
I removed Aspose.Pdf package (from NuGet) in AsposeDLL project, replace it to the dll download from ASPOSE Official Website.
The dll is 22.9, I choose netstandard2.0 version… and it’s worked.
I’m curious on why using netstandard2.0 version, not 4.6.1?
Did you change the .NET Framework version when Aspose.PDF was already installed? We tested in our environment and API did not create any issue when we installed it using Nuget. Nevertheless, it is nice to hear that your issue has been resolved. Please keep using our API and feel free to create a new topic in case you need further assistance.