SetLicense in .Net Core

Hello,

Upon converting our project that uses Aspose Total 19.6.0.0 to .Net Core (2.2), we have discovered that we are unable to set the Aspose license on any associated libraries (Words, Cells, etc). The original project is an Azure Function product, however, we have since rolled a most basic .Net Core console project to test the issue with same results.

The error we are receiving is:

Could not load type ‘System.Runtime.Remoting.RemotingServices’ from assembly…

Remoting has been removed from .Net Core so my question is whether Aspose is aware of the issue and preferably that there is a fix available.

Thank you.

@pslobodian

It seems that the reason of your problem is that minificator does not see code in virtualized methods and as a result it does not include libraries required by this code into the final build. To work the problem around the you can include this option into the project:

    <ItemGroup>
      <TrimmerRootAssembly Include="mscorlib" />
      <TrimmerRootAssembly Include="System.Xml" />
    </ItemGroup>

Hope this helps you. If you still face problem, please share your working environment along with complete detail of your use case? We will then provide you more information about this query.

1 Like

Thank you for your reply Tahir. Unfortunately the suggestion given herein does not resolve the issue (in the Azure Function project nor in the standard console one). I’m not sure what further information I may provide other than that I’m using Visual Studio 2017 for this.

Thanks again

@pslobodian

Could you please create separate application for Aspose.Words and Aspose.Cells and check for which product you are facing this issue? Thanks for your cooperation.

Hello Tahir,

The first product we’re facing the issue with is Aspose.Words. Its as basic a test application as possible. The main cause for concern is that Remoting Services have been removed from .Net Core (please refer to .NET Framework technologies unavailable on .NET 6+ | Microsoft Learn) and Aspose licensing attempts to reference said tech. Have you guys been successful at running .Net Core apps with licensing? If so, may I have a sample to ensure I’m not missing anything obvious.

Thank you for your continued support.

@pslobodian

We have logged this problem in our issue tracking system as WORDSNET-19384. We will inform you via this forum thread once there is an update available on it. We apologize for your inconvenience.

@pslobodian

Aspose.Words for .NET does not use Remoting Services. So, there should not be any issue using Aspose.Words with .NET Core 2.2. We have tested the scenario using the latest version of Aspose.Words for .NET 19.10 and have not found the shared issue.

Please use the latest version of Aspose.Words for .NET 19.10. If you still face problem, please ZIP and attach simplified project to reproduce your issue at our end. Thanks for your cooperation.

Hello Paul

I am analyzing the issue you recently reported, but unfortunately, I cannot reproduce it on my side. I created a simple .NET Core 2.2 console application added reference to Aspose.Words and put a simple code to set license and create a simple document.

License lic = new License();
lic.SetLicense(@"X:\awnet\TestData\Licenses\Aspose.Words.NET.lic");
DocumentBuilder builder = new DocumentBuilder();
builder.Writeln("Hello from .NET Core 2.2");
builder.Document.Save(@"C:\Temp\out.docx");

Everything works smoothly on my side. Also, before release and in process of development we run unit tests on both .NET Framework and .NET Core 2.0 (because the lowest version of .NET Standard Aspose.Words supports is 2.0). The tests cover setting different types of licenses as well.

Could you please share the code you use to set license, I will check it on my side and provide you more information.

Hello and cheers. Upgrading to the latest version (from 19.6 to 19.10) does indeed resolve this issue. Thank you everyone for your support.

The issues you have found earlier (filed as WORDSNET-19384) have been fixed in this Aspose.Words for .NET 19.11 update and this Aspose.Words for Java 19.11 update.

Thank you, @tahir.manzoor

I got same problem recently, and solved by your post.