Hi,
With Aspose.PDF 17.4.0 the following error occours:
Object reference not set to an instance of an object.
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense(“Aspose.Total.lic”);
Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
Source: Aspose.Pdf
TargetSite: Void (System.IO.Stream)
StackTrace:
bei _ .(Stream )
bei _ .(String _, Assembly _)
bei Aspose.Pdf.License.SetLicense(String licenseName)
What’s the resason for this? With v17.2.0 it works without problems.
Regards,
Heiko
Hi Heiko,
Hi Nayyer,
I’ve sent a code snippet and the license file via e-mail.
Regards,
Heiko
Hi Heiko,
Hi Nayyer,
With a (new) sample project everything is fine.
We will wait for version 17.5.0 and try again.
Regards,
Heiko
Hi Heiko,
Hi,
We have encountered a similar issue and I thought I would continue this thread. Please let me know if I should start a new one.
We are on Aspose.PDF version 17.2 and one of our servers throws the following errors intermittently. Other servers and other environments do not have this issue. With our POC applicaitons using the license too, this error isn’t present.
System.NullReferenceException: Object reference not set to an instance of an object. at _ ._(Stream _) at _ ._(String _, Assembly _) at Aspose.Pdf.License.SetLicense(String licenseName) at ....AsposeLicenseManager.SetLicense() in ...\Common\AsposeLicenseManager.cs:line 48 at ...
Helko mentioned this error occured with 17.4 and did not occur with 17.2. We see this similar error with 17.2.
The code we have for setting license:
string LicensePath = asposeSection?["LicensePath"];
...
public bool SetLicense()
{
if (!IsLicenseAvailable)
{
// TODO: write a log message
return false;
}
new Aspose.Pdf.License().SetLicense(LicensePath);
new Aspose.Cells.License().SetLicense(LicensePath);
new Aspose.Words.License().SetLicense(LicensePath);
return true;
}
Please advise.
Thanks,
Praveen
@koosala4,
Kindly send us your license file through a private message. We will investigate and share our findings with you.
@koosala4,
Thank you for sending the license file. We have tested your license file with the latest versions of Aspose.Cells, Aspose.Words and Aspose.Pdf APIs. We are unable to replicate this error in our environment. Kindly create a small project application which reproduces this error in your environment, and then send us a Zip of this project. Please also share details of the problematic environment, including Operating System (name & edition), local language settings and some handy information which could help us to replicate this error in our environment. Your response is awaited.
This problem is open in many threads and there is nowhere an answer to it. We have this problem also on our side. It happens some times but not always. I could replicate the problem by closing the whole visual studio and starting it again. After doing that the problem arises the first time
Thanks for contacting support.
We had noticed such issue in the past and it was resolved in latest version of the API. Would you please make sure to use latest version of the Aspose APIs and in case you still face any issue, please share with which specific API issue is occurring. It would also be helpful if you can please share a sample application along with the details of steps for reproducing the issue. We will test the scenario in our environment and address it accordingly.
Is there any workaround for former versions? It is not possible for us right now to go to the latest version.
Would you please confirm the API with which you are facing this issue and which version are you using at your side.
It happens when I use this line of code:
licensePdf.SetLicense(“MyNamespace.DocumentGeneration.Aspose.Pdf.lic”)
and I am using Aspose version 17.1.0.0.
Thanks
I am afraid that you are using quite old version of the API. However, you may please try changing routine of setting your license according to details given over following link:
We hope this may help resolving your issue. In case issue still persists, please let us know by sharing a sample application. We will further proceed to help you out.