Hello. What is the best way to handle licensing across environments?
We have a license for Aspose.Total, but are mainly using just the PDF and Words aspects at the moment. I know I have to initialize a license for each beforehand, which I am doing in the Global.asa and I initialize a license for each. This was simple to do for the PDF, as I just added the license to the project, set it as embedded and worked like a charm. For Words, embedded is not an option, so I had to have the license present on the server and then access it with a stream reader,
Is this the best way? Would be nice to have consistency of the code across aspects of the Total Product, especially for something like licensing, but that does not seem possible.
Other somewhat related, is I am looking to move off all this functionality into a utility class which then can just be referenced from some of our other projects, and I was going to do this through creating a C# Framework class? Since there is no Global ASA, where is it best to initialize the license?
Hope this makes sense
@dlaskey
Thank you for contacting support.
Would you please elaborate if you are satisfied with using the license as Embedded Resource. If it is fine then please note that Aspose.Words for .NET also supports Including the License File as an Embedded Resource. Moreover, you may also compress or encrypt the license with password as explained at License as Embedded Resource.
We hope this information will be helpful. Please feel free to contact us if you need any further assistance.
Embedding worked fine for me for PDF license, but not for Words. This is my section for Global.asa Application_Start
Aspose.Pdf.License license = new Aspose.Pdf.License();
Aspose.Words.License license2 = new Aspose.Words.License();
license.SetLicense(“Aspose.Total.lic”);
// Set the value to indicate that license will be embedded in the application
license.Embedded = true;
MemoryStream stream = new MemoryStream(File.ReadAllBytes(@“C:\Aspose\Aspose.Total.lic”));
license2.SetLicense(stream);
When I try and do license2.Embedded = true;, it throws an error and for the Words License class, it does not appear to handle Embedded as a attribute
@dlaskey
Thank you for the feedback. We are looking from Aspose.Words perspective and will share our findings with you shortly.
@dlaskey
Please note that Aspose.Words does not has Embedded property in License class. Please remove license.Embedded = true; from your code.
Please refer to the following article about how to embed license in your application.
Including the License File as an Embedded Resource