EasyXLS library uses a secured file for licensing. The default license file name is license.lic. The content of the license file must not be altered in any way or it will become invalid.
The license can be loaded from:
- the same folder where EasyXLS.dll or EasyXLS.jar file is - a custom path on machine - an input stream or a memory stream - an embedded resource file - an XML string
Method 1: License file in default runtime directory
license.lic file must be present in the current directory of the application.
Some common samples of paths when developing in Visual Studio are: - C:\MyProject\bin\Debug for .NET Framework or - C:\MyProject\bin\Debug\netcoreapp for .NET Core
Optionally, license.lic file can be included in project and set the 'Copy to Output Directory' property as 'Copy always'.
If not sure about your current environment folder, you can use the code below to detect it:
Console.WriteLine("The license must be placed in '" +
Environment.CurrentDirectory + "' folder");
Console.WriteLine("The license must be placed in '" &
Environment.CurrentDirectory & "' folder")
Console::WriteLine("The license must be placed in '" +
Environment::CurrentDirectory + "' folder");
import clr
import gc
from System import *
print ("The license must be placed in '" +
Environment.CurrentDirectory + "' folder")
Method 2: License file near EasyXLS.dll
license.lic file must be placed in the same folder where EasyXLS.dll is present in the runtime environment.
Some common samples of paths when developing in Visual Studio are: - C:\MyProject\bin\Debug for .NET Framework or - C:\MyProject\bin\Debug\netcoreapp for .NET Core - C:\MyProjectWeb\MyProjectWeb\bin for web projects
Optionally, license.lic file can be included in project and set the 'Copy to Output Directory' property as 'Copy always'.
If not sure about your runtime environment folder, you can use the code below to detect it:
string codebase = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
UriBuilder uriCodebase = new UriBuilder(codebase);
codebase = Uri.UnescapeDataString(uriCodebase.Path);
string licenseFilePath = System.IO.Path.GetDirectoryName(codebase);
Console.WriteLine("The license must be placed in '" +
licenseFilePath + "' folder");
Dim codebase As String = System.Reflection.Assembly.GetExecutingAssembly().CodeBase
Dim uriCodebase As New UriBuilder(codebase)
codebase = Uri.UnescapeDataString(uriCodebase.Path)
Dim licenseFilePath As String = System.IO.Path.GetDirectoryName(codebase)
Console.WriteLine("The license must be placed in '" +
licenseFilePath + "' folder")
String ^codebase = System::Reflection::Assembly::GetExecutingAssembly()->CodeBase;
UriBuilder ^uriCodebase = gcnew UriBuilder(codebase);
codebase = Uri::UnescapeDataString(uriCodebase->Path);
String ^licenseFilePath = System::IO::Path::GetDirectoryName(codebase);
Console::WriteLine("The license must be placed in '" +
licenseFilePath + "' folder");
Method 3: License file with a custom name or location
license.lic file can be renamed, but the new name must be set from your application. The renamed license file can be placed near EasyXLS.dll or loaded from a custom folder.
ExcelDocument workbook = new ExcelDocument();
workbook.getLicenseSetup().setLicenseFile("CustomName.lic");
workbook.getLicenseSetup().setLicenseFilePath("C:\\CustomFolder");
Dim workbook As New ExcelDocument()
workbook.getLicenseSetup().setLicenseFile("CustomName.lic")
workbook.getLicenseSetup().setLicenseFilePath("C:\CustomFolder")
The license protection can be set from a stream. The stream can load the content of the license.lic from disk, can be a MemoryStream or any other System.IO.Stream, but its content must be identical with the content of license.lic file.
license.lic file must be included into the project and set the 'Build Action' property as 'Embedded Resource'.
If the license file is renamed, apply also the code from Method 3.
Method 6: License from XML string
The license protection can be set directly from the code without any additional license file using an XML string. The XML string must be identical with the content of the license.lic file.
license.lic file must be placed in the same folder where EasyXLS.dll that was registered as COM+ component is present.
The default locations when using EasyXLS installer for registration are: - C:\Program Files\EU Outsourcing\EasyXLS COM+ Professional v9.0\COM+ version\DLL or - C:\Program Files (x86)\EU Outsourcing\EasyXLS COM+ Professional v9.0\COM+ version\DLL
If EasyXLS was installed on a different folder or EasyXLS.dll was manually registered from a different location, license.lic file must be placed near that specific EasyXLS.dll.
Your application must have reading permissions for the license file.
Method 2: License file with a custom name or location
license.lic file can be renamed, but the new name must be set from your application. The renamed license file can be placed near EasyXLS.dll or loaded from a custom folder.
Your application must have reading permissions for the license file.
Set workbook = CreateObject("EasyXLS.ExcelDocument")
workbook.getLicenseSetup().setLicenseFile("CustomName.lic")
workbook.getLicenseSetup().setLicenseFilePath("C:\CustomFolder")
Set workbook = CreateObject("EasyXLS.ExcelDocument")
workbook.getLicenseSetup().setLicenseFile("CustomName.lic")
workbook.getLicenseSetup().setLicenseFilePath("C:\CustomFolder")
Method 3: License from XML string
The license protection can be set directly from the code without any additional license file using an XML string. The XML string must be identical with the content of the license.lic file.
String jarLocation = ExcelDocument.class.getProtectionDomain().
getCodeSource().getLocation().toURI().getPath();
System.out.println("The license must be placed in '" +
new File(jarLocation).getParent() + "' folder");
<cfset jarLocation = workbook.getClass().getProtectionDomain().
getCodeSource().getLocation().toURI().getPath()><cfobject type="java" class="java.io.File" name="fileLocation" action="CREATE"><cfset fileLocation.init(jarLocation)><cfoutput>
The license must be placed in
'#fileLocation.getParent()#' folder
</cfoutput>
$jarLocation = java("EasyXLS.ExcelDocument")->getProtectionDomain()->
getCodeSource()->getLocation()->toURI>getPath();
$jarParent = new java("java.io.File", $jarLocation);
echo "The license must be placed in '" .
$jarParent->getParent() . "' folder";
jarLocation = workbook.getClass().getProtectionDomain(). \
getCodeSource().getLocation().toURI().getPath()
print("The license must be placed in '" +
gateway.jvm.java.io.File(jarLocation).getParent() + "' folder")
Method 3: License file with a custom name or location
license.lic file can be renamed, but the new name must be set from your application. The renamed license file can be placed near EasyXLS.jar or loaded from a custom folder.
The license protection can be set from a stream. The stream can load the content of the license.lic from disk, can be a java.io.ByteArrayInputStream or any other java.io.InputStream, but its content must be identical with the content of license.lic file.
license.lic file must be included into the project.
Additionally, the license file can be included in a JAR file.
If the license file is renamed, apply also the code from Method 3.
Method 6: License from XML string
The license protection can be set directly from the code without any additional license file using an XML string. The XML string must be identical with the content of the license.lic file.
The license file for server license and developer license expires after two years and must be renewed with no additional costs.
After two years, a notification is sent to announce that the license file is about to expire. The notification will be sent to the owner of the license key and optionally to the email address provided when the license file was generated.
The trial license file expires after 30 days and cannot be renewed. Contact us at support@easyxls.com for a new trial license key.