We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

License error randomly appearing

I am using Aspose words in an asp.net v2.0 application using C#. A correct license file has been copied into the bin directory of the website where the aspose dll is contained. However we seem to get random messages saying that the license has not been applied. These messages also go away when you refresh the page. The code we are using is as follows.

Document doc = new Document(stream);

License license = new License();

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

doc.SaveOptions.HtmlExportTextInputFormFieldAsText = true;

using (Stream output = new MemoryStream())

{

doc.Save(output, SaveFormat.Html);

using(StreamReader sr = new StreamReader(output))

{

sr.BaseStream.Position = 0;

html = sr.ReadToEnd();

ok = true;

}

}

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. This occurs because you are setting license after creating Document. You need to set license before instantiating any other Aspose.Words classes. Please see the following link to learn when to apply license:

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/when-to-apply-a-license.html

Best regards.