Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.HTML for .NET can be tested before purchase and then switched to licensed mode by applying a license in your C# application. The evaluation version is the same product package as the purchased version, but it has output and collection limitations until a valid license is applied.
If you want to test Aspose.HTML for .NET without evaluation version limitations, request a 30-day Temporary License. Apply the temporary license in code the same way as a purchased license file.
You can download Aspose.HTML for .NET for evaluation purposes and use the same APIs that are available in the licensed version. Without a license, the library provides full product functionality, but the generated output and some collections are limited.
The evaluation version has the following limitations:
After purchase, apply the license file before using Aspose.HTML APIs that create, save, render, or convert documents. You can load the license from disk, from a stream, from an embedded resource, or use a metered license.
Use the fully qualified license class name. If you use another Aspose for .NET component together with Aspose.HTML for .NET, specify the complete namespace for the license class, such as
Aspose.Html.License or
Aspose.Html.Metered. Each Aspose product has a License class in its own namespace. For example, Aspose.HTML uses
Aspose.Html.License and Aspose.SVG uses
Aspose.Svg.License. The fully qualified class name helps avoid applying a license to the wrong product namespace.
The easiest way to apply a license is to put the license file in the same folder as Aspose.HTML.dll and specify only the file name without a path.
To apply a license file in C#:
.lic file to the application folder or another path available at runtime.1// Initialize a license object
2Aspose.Html.License htmlLicense = new Aspose.Html.License();
3
4// Apply the license using the file name
5htmlLicense.SetLicense("Aspose.HTML.lic");Use a stream when the license file is stored outside the application folder, loaded from secured storage, or provided by deployment configuration.
1// Initialize a license object
2Aspose.Html.License htmlLicense = new Aspose.Html.License();
3
4// Open a license file stream
5using (var stream = new System.IO.FileStream("Aspose.HTML.lic", System.IO.FileMode.Open))
6{
7 // Apply the license using the stream
8 htmlLicense.SetLicense(stream);
9}A common application pattern is to apply the license once at startup or through lazy initialization before the first Aspose.HTML workflow runs. This keeps licensing code centralized and avoids repeating SetLicense() calls throughout the project.
1internal class LicenseSingleton
2{
3 private static LicenseSingleton _instance = new LicenseSingleton();
4
5 private LicenseSingleton()
6 {
7 // Initialize the license
8 (new Aspose.Html.License()).SetLicense(@"F:\aspose.html.net\testdata\license\Aspose.HTML.NET.lic");
9 }
10
11 public static void SetLicense()
12 {
13 LicenseSingleton local = _instance;
14 }
15}
16
17static void Main(string[] args)
18{
19 // Lazy initialization before using the library
20 LicenseSingleton.SetLicense();
21}Another way to package a license with your application is to include it as an embedded resource in one of the assemblies that calls Aspose.HTML for .NET.
To include the license file as an embedded resource:
.lic file in your project by right-clicking the project and choosing Add > Existing Item….1// Initialize a license object
2Aspose.Html.License htmlLicense = new Aspose.Html.License();
3
4// Apply the license using the embedded resource name
5htmlLicense.SetLicense("Aspose.HTML.lic");Resources are embedded into an assembly without modification. If you add a license file as an embedded resource, anyone who can inspect the resulting assembly may be able to see or extract the license contents. Use this approach only when it matches your deployment and security requirements.
Metered licensing is a licensing mechanism used alongside the existing license file approach. Customers who want to be billed based on API feature usage can apply metered keys instead of a license file. For more details, see Using Your Metered License.
After completing the required steps to obtain this type of license, you receive public and private keys rather than a license file. Apply these keys with the Aspose.Html.Metered class.
1// Initialize a metered object
2Aspose.Html.Metered metered = new Aspose.Html.Metered();
3
4// Apply the metered license using the public and private keys
5metered.SetMeteredKey("*****", "*****");Normally, it is enough to apply the metered license once on application start. However, if the metered licensing mechanism fails to communicate with Aspose servers for 24 hours, Aspose.HTML exits licensed mode and switches to evaluation mode. To avoid this case, regularly check the license status. If Aspose.HTML switches to evaluation mode, apply the metered license again.
To use a Metered license correctly, you must have a stable Internet connection because the Metered mechanism requires regular interaction with Aspose services for correct calculations. For more information, see the Metered Licensing FAQ.
| Issue | Cause | Fix |
|---|---|---|
| Output files still contain evaluation watermarks | The license was not applied before saving or converting documents, or the application cannot find the .lic file at runtime. | Call SetLicense() before using Aspose.HTML APIs and verify that the license file is copied to the runtime folder or loaded from the correct path. |
| The wrong Aspose product remains in evaluation mode | The project uses several Aspose products and the license was applied through a License class from another namespace. | Use the fully qualified class name, for example Aspose.Html.License, when applying the Aspose.HTML license. |
| License works locally but fails on a server or in Docker | The license file is not deployed with the application, the path differs, or the container image does not include the file. | Include the license in deployment artifacts, mount it securely, or load it from a stream or secured configuration source. |
| Embedded license can be extracted from the assembly | Embedded resources are stored in the assembly without encryption or modification. | Use embedded resources only when this security tradeoff is acceptable. For stricter deployments, load the license from protected storage. |
| Metered license switches to evaluation mode | The application cannot communicate with Aspose services for 24 hours or longer. | Keep a stable Internet connection for metered licensing and reapply the metered keys if the application enters evaluation mode. |
No. The evaluation version and purchased version use the same Aspose.HTML for .NET package. The package becomes licensed after you apply a valid license in code.
Apply the license at application startup or before the first Aspose.HTML operation that loads, saves, renders, or converts documents. This avoids evaluation watermarks and output limits.
Yes. A 30-day temporary license lets you test Aspose.HTML for .NET without evaluation limitations. Apply it with Aspose.Html.License.SetLicense() like a purchased license file.
Use a license file for standard commercial licensing. Use a metered license when your purchase model is based on API usage and the application can maintain regular Internet access to Aspose services.
Yes. Apply each product license through its own namespace-specific license class, such as Aspose.Html.License for Aspose.HTML and Aspose.Svg.License for Aspose.SVG.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.