Hello,
I’m facing an issue when setting license that reproduces every while and no i don’t have a clear scenario for reproduction.
I’m using the license as embedded resource
below is my code used :
public void SetLicence(
{
string license = “Aspose.Total.Product.Family.lic”;
this.SetLicence(license);
}<span style="color:blue;">public</span> <span style="color:blue;">void</span> SetLicence(<span style="color:blue;">string</span> license) { <span style="color:blue;">using</span> (System.Security.Principal.<span style="color:#2b91af;">WindowsImpersonationContext</span> ctx = System.Security.Principal.<span style="color:#2b91af;">WindowsIdentity</span>.Impersonate(System.<span style="color:#2b91af;">IntPtr</span>.Zero)) { Aspose.Imaging.<span style="color:#2b91af;">License</span> licenseImaging = <span style="color:blue;">new</span> Aspose.Imaging.<span style="color:#2b91af;">License</span>(); licenseImaging.SetLicense(license); Aspose.Words.<span style="color:#2b91af;">License</span> licenseWord = <span style="color:blue;">new</span> Aspose.Words.<span style="color:#2b91af;">License</span>(); licenseWord.SetLicense(license); Aspose.Slides.<span style="color:#2b91af;">License</span> licenseSlide = <span style="color:blue;">new</span> Aspose.Slides.<span style="color:#2b91af;">License</span>(); licenseSlide.SetLicense(license); Aspose.Pdf.<span style="color:#2b91af;">License</span> licensePdf = <span style="color:blue;">new</span> Aspose.Pdf.<span style="color:#2b91af;">License</span>(); licensePdf.SetLicense(license); Aspose.Cells.<span style="color:#2b91af;">License</span> licenseCells = <span style="color:blue;">new</span> Aspose.Cells.<span style="color:#2b91af;">License</span>(); licenseCells.SetLicense(license); Aspose.Diagram.<span style="color:#2b91af;">License</span> licenseDiagram = <span style="color:blue;">new</span> Aspose.Diagram.<span style="color:#2b91af;">License</span>(); licenseDiagram.SetLicense(license); } }</pre><pre style="background-color: white;"><font face="Times New Roman">I'm getting the following error: Object reference not set to an instance of an object.</font></pre><pre style="background-color: white;"><font face="Times New Roman">After an iisreset everything works normally again</font></pre><pre style="background-color: white;"><font face="Times New Roman">Any advice? </font></pre><pre style="background-color: white;"><font face="Times New Roman">Thank you<span style="font-size: 13px;"> </span></font></pre><pre style="font-family: Consolas; font-size: 13px; background-color: white; background-position: initial initial; background-repeat: initial initial;"><br></pre></div>