Getting error when accessing license file using Aspose.Words (from Bin)

This works fine in VM dev/environments, when we moved this to QA/Prod, we are observing this issue. This is highly urgent!
We have a valid license for Aspose.words. We are using version (10.5.0.0).

  1. I have copied the license file into the bin folder that contains assemblies of my project and have created an object of the Aspose.Words.License class and called the SetLicense method passing only the file name of the license file without path as below:
Aspose.Words.License license = new Aspose.Words.License(); 
license.SetLicense("Aspose.Words.lic");

Getting a similar issue as in the link :
https://forum.aspose.com/t/55594

Hi
Thanks for your request. You have few options to go from here:

  1. You can use the license file as an embedded resource as described here:
    https://docs.aspose.com/words/net/licensing/
  2. You can set the license from stream. In your case, this does not word probably because position of the stream is incorrect. Try to set position of stream to the beginning:
// GetAppropriateAssetStream method reads stream from the .lic file
Stream licStream = GetAppropriateAssetStream("AsposeLicense");
licStream.Position = 0;
Aspose.Words.License license = new Aspose.Words.License();
license.SetLicense(licStream);
  1. You can set the license form an explicit path.

Hope this helps.

Best regards,

The solution provided resolved the issue.
Thanks a lot!

Hi
It is perfect that you managed to resolve the problem. Please feel free to ask in case of any issues, we are always glad to help you.
Best regards,