The SetLicense() method doesn’t throw the exception if the provided license file’s path is incorrect. In that case, the evaluation watermark will appear in the output. It is better to apply the license using the file stream as shown in the below code samples. In this case, an exception will be thrown if there is some issue with the file’s path or permissions.
C#:
using (FileStream fileStream = new FileStream(LICENSE_FILE_PATH, FileMode.Open, FileAccess.Read))
{
License lic = new License();
lic.SetLicense(fileStream);
}
Java:
FileInputStream licenseStream = new FileInputStream(LICENSE_FILE_PATH);
License lic = new License();
lic.setLicense(licenseStream);