I would like to answer from Aspose.Pdf for .NET perspective. Please try using following code lines to use the license file as an embedded resource. In case you still face any problem, please feel free to contact.
[C#]
// create a Pdf license object Aspose.Pdf.License lic = new Aspose.Pdf.License(); // specify the license file name along with Default namespace of application lic.SetLicense(“MergedAPI.Aspose.Total.lic”); // set the value to indicate that license will be embedded in the application lic.Embedded = true;
Where MergedAPIis the default Namespace of my project (Right Click Solution in Solution Explorer and select Properties. You will see the page with Default Namespace information).
And what about the other libraries ? Do I need to have a licence for each used product?
If you have Aspose.Total.Product.Family.lic for Aspose.Total for .NET products, then this single license file can be used with all the products under Aspose.Total for .NET umbrella. However you need to explicitly initialize the license for individual product, like you did you your code snippet.
When i’m settingMergedAPI.Aspose.Total.Product.Family.lic as my license name an exception in thrown “Cannot find license ‘MergedAPI.Aspose.Total.Product.Family.lic’”, am i missing something?
The license file name i have is:Aspose.Total.Product.Family.lic
The Embedded property is only for aspose.PDF license object, the other products can’t have an embedded resource or if i set the pdf one as to true will be enough?
can you please clarify more how to avoid the null reference error i’m getting every once in a while?
When i'm setting MergedAPI.Aspose.Total.Product.Family.lic how to as my license name an exception in thrown "Cannot find license 'MergedAPI.Aspose.Total.Product.Family.lic'", am i missing something?
The license file name i have is: Aspose.Total.Product.Family.lic
Hi Hiba,
Thanks for sharing the details and sorry for the delayed response.
When using earlier stated approach, the license file must be included as embedded resource and Default namespace of application should be provided when initializing the license for Aspose.Pdf for .NET. Please ensure that the license (Aspose.Total.Product.Family.lic) is included as an embedded resource in solution.
hri:
The Embedded property is only for aspose.PDF license object, the other products can't have an embedded resource or if i set the pdf one as to true will be enough?
For every API, you need to explicitly initialize the license. However concerning to your query on embedded property for other API's, I have asked my fellow workers to answer this query.
Adding more to my earlier comments, can you please add some breakpoints in your code while initializing license for individual API and determine the code line causing this exception.
I have observed the requirement for property to tell if the license used is embedded inside application for Aspose.Slides on my end. I regret to share that at present the requested property is unavailable in Aspose.Slides. I have created an issue with ID SLIDESNET-35194 in our issue tacking system to further investigate this on our end. This thread has been linked with the issue so that you may be automatically notified once the support will be available.
The Embedded property is only for aspose.PDF license object, the other products can’t have an embedded resource or if i set the pdf one as to true will be enough?
Thank you for reporting us about the embedded property. At the moment, it is not available. I’ve logged this feature request in our issue tracking system under ticket id DIAGRAMNET-50061 for Aspose.Diagram. Your request has been linked to this issue. We will notify you once it is supported. We’re sorry for your inconvenience.