Install GroupDocs.Assembly for .NET and Apply License
Leave feedback
Overview
Before you can start generating documents with GroupDocs.Assembly for .NET, you need to install the library and apply a license. This guide shows you how to install the package via NuGet and configure licensing to remove evaluation limitations.
Install GroupDocs.Assembly package via NuGet Package Manager or Package Manager Console
Apply a license from a file or stream using the License.SetLicense method
Verify that the license is applied correctly before using DocumentAssembler
Note
Calling License.SetLicense multiple times is not harmful but wastes processor time. In Windows Forms or console applications, call it once during startup. In ASP.NET applications, call it in Application_Start method in Global.asax.cs.
Install via NuGet Package Manager
The easiest way to install GroupDocs.Assembly is through NuGet Package Manager in Visual Studio.
Right-click your project in Solution Explorer
Select “Manage NuGet Packages”
Search for “GroupDocs.Assembly”
Click “Install” to install the latest version
Install via Package Manager Console
Alternatively, you can install the package using Package Manager Console:
// Run this command in Package Manager Console:// Install-Package GroupDocs.Assembly
Apply License from File
After installation, apply your license file to remove evaluation limitations:
usingGroupDocs.Assembly;publicstaticvoidApplyLicenseFromFile(){// Path to your license filestringlicensePath="GroupDocs.Assembly.lic";// Apply the licenseLicenselicense=newLicense();license.SetLicense(licensePath);Console.WriteLine("License applied successfully from file.");}
Apply License from Stream
You can also load a license from a stream:
usingGroupDocs.Assembly;usingSystem.IO;publicstaticvoidApplyLicenseFromStream(){// Load license file into a streamusing(FileStreamstream=newFileStream("GroupDocs.Assembly.lic",FileMode.Open)){Licenselicense=newLicense();license.SetLicense(stream);Console.WriteLine("License applied successfully from stream.");}}
Verify License Application
To verify that your license is applied correctly, you can check for evaluation watermarks in generated documents. If no watermarks appear, the license is active.
usingGroupDocs.Assembly;publicstaticvoidVerifyLicense(){Licenselicense=newLicense();license.SetLicense("GroupDocs.Assembly.lic");// Try to assemble a simple documentDocumentAssemblerassembler=newDocumentAssembler();// If license is valid, no evaluation watermark will appearConsole.WriteLine("License verification: Check generated documents for watermarks.");}
Warning
The license file contains a digital signature. Do not modify the license file, as even adding an extra line break will invalidate it.
Advanced Usage Topics
To learn more about licensing options including metered licensing, please refer to the advanced usage section.
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples: