Applying license on .net core

Hello support team,
I’ve got a temporary license that I want to apply to our .net core application.
Following your guide,
I have copied the “Aspose.Words.lic” file to the “Publish Output” directory (where the Aspose.Words.dll is stored" and copied your example code to the Startup.cs class of the core application.
Unfortunately, the execution failed while got to :

license.SetLicense("Aspose.Words.lic");

The received exception is:
“The invoked member is not supported in a dynamic assembly.”

Could you please direct me what am I doing wrong?
Appreciate your support,

Thanks,
Guy

@GuyCmls

Thanks for your inquiry. To ensure a timely and accurate response, please share the following detail here for testing:

  • Please share your .NET Core project here for testing.
  • Please do not share your license file.
  • Please share at which operating system you are executing the published application.

Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Hello,
Thanks for your reply,

I am working on a standard MVC project based on .Net core 2.0.3
Running on Windows Server 2016,

please find attached a demo project that run on the same operation systems and framework which implements Aspose.Words in the same way that I am using it in the real application,

coreMvcForAspose.zip (1015.6 KB)

Looking forward to your response,

Thanks,
Guy

@GuyCmls

Thanks for sharing the detail. We are investigating this issue and will get back to you soon.

@GuyCmls

Thanks for your patience. We have tested the scenario using latest version of Aspose.Words for .NET 18.10 and have not found the shared issue. This issue seems not to be related to Aspose.Words. Please make sure you have installed Microsoft Visual C++ Redistributable for Visual Studio 2017. Moreover, we suggest you please check the following web links.

The invoked member is not supported in a dynamic assembly

Thanks for your reply,
Unfortunately I am afraid that my point was missed.
in your “applying license” guide it says:

As this description is good for .Net, it doesn’t provide explanation for .NET Core who doesn’t have Global.asax.cs nor Application_Start method

could you please guide how to apply your license in .Net Core MVC application?

(please forget about the error I described, this was just result of my looking at the dark attempts, I’d be thankful if you could instead just let me know what I should do)

A quick response would be appreciated as it is needed for getting decisions for commercial application,

Thanks,
Guy

@GuyCmls

Thanks for your inquiry. In your case, you need to call the License.SetLicense method in Startup.cs class. You can add following code in Startup constructor.

Aspose.Words.License lic = new Aspose.Words.License();
lic.SetLicense(@"Aspose.Words.lic");

Thanks for your reply,
As you can see in my first message, this is exactly what I have done at first place.
Unfortunately it didn’t work as instead it yielded the “The invoked member is not supported in a dynamic assembly.” exception.

I also moved this code t the controller constructor and that also didn’t work

I tried storing the lic file both in “~\DotNetCoreApp\bin\Debug\netcoreapp2.0\” folder. and in the “~\DotNetCoreApp\bin\Release\netcoreapp2.0\”

Also, installed the Microsoft Visual C++ Redistributable for Visual Studio 2017 as you suggested. but I kept geeting the same exception every time

Could you please send me a working example with a license applied (it would be the best if you use the demo app that I sent you as a starting point)

or at least give me access to the example you sent in your other correspondence here

I’d appreciate it if you could make an extra effort to try and resolve this issue in the next few hours as we have a critical release today and we have been counting on your solution,

Thanks,
Guy

@GuyCmls

Thanks for your inquiry.

Please check the attached Startup.cs file. Startup.zip (700 Bytes)

We have not found the shared issue at our end. Could you please try the same example at some other system?

If you still face problem, please share the screenshot of the error you are facing. Please also share the “Publish Output” folder for further testing.

This code example does not use Startup.cs. However, we have attached it with this post.
DotNetCoreApp.zip (753.2 KB)