The license is a plain text XML file that contains details such as the product name, number of developers it is licensed to, subscription expiry date and so on. The file is digitally signed, so do not modify the file. Even inadvertent adding of an extra line break into the file will invalidate it.
You need to set a license before performing any operations with documents. It is only required to set a license once per application or process.
The license can be loaded from a file, stream or an embedded resource. Aspose.Spell will try to find the license in the following locations:
- Explicit path.
- The folder that contains Aspose.Spell.dll.
- The folder that contains the assembly that called Aspose.Spell.dll.
- The folder that contains the entry assembly (your .exe).
- An embedded resource in the assembly that called Aspose.Spell.dll.
Use the License.SetLicense method to license the component. The easiest way to set a license is to put the license file in the same folder as Aspose.Spell.dll and specify just the file name without path as shown in the following example:
[C#]
Aspose.Spell.License license = new Aspose.Spell.License();
license.SetLicense("Aspose.Spell.lic");
[VB.NET]
Dim license As Aspose.Spell.License = New Aspose.Spell.License
license.SetLicense("Aspose.Spell.lic")
The following example shows how to load a license from a stream:
[C#]
Aspose.Spell.License license = new Aspose.Spell.License();
license.SetLicense(myStream);
[VB.NET]
Dim license As Aspose.Spell.License = New Aspose.Spell.License
license.SetLicense(myStream)