Get License From Stream


#1

I added the license file to a project (at the root level) and am trying to load the license file using a stream. When I open the resulting spreadsheet, the license file failed to load indicated by bad data in some of the fields.

Why doesn't this work?:

License license = new License();
Assembly assembly = Assembly.GetExecutingAssembly();
Stream licenseStream = assembly.GetManifestResourceStream("Aspose.Excel.lic");
license.SetLicense(licenseStream);

Aaron


#2

Hi Aaron,

If you add license file to a project, please right click it and choose build action to "Embedded Resource" in properties window. Then you can use the follow code:

License license = new License();
license.SetLicense("Aspose.Excel.lic");

Please check http://www.aspose.com/Wiki/default.aspx/Aspose.Excel/LicensingComponent.html for more information.