We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Unable to register community license inside the app.

I'm kind of lost as to how to get Syncfusion working. I'd like to use it to generate PDF files in my applications.

I started by installing Essential Studio for WPF on the 30 trial. The syncforge controls appeaered in the toolbox in Visual Studio.

Then I followed this guide: https://help.syncfusion.com/file-formats/pdf/create-pdf-file-in-c-sharp-vb-net#creating-a-pdf-document-with-simple-text

to try to create a simple sample PDF, but Visual Studio didn't recognize any of the libraries in the using statements. 

So I installed the Syncfusion NuGet package for WPF PDF, and then it was good. I was able to generate the sample PDF covered in the above tutorial.

I applied for the community license and was approved. I got the license key and followed this guide: https://help.syncfusion.com/common/essential-studio/licensing/how-to-register-in-an-application

to try to register my key within my app. I used the following code in my App.xaml.cs as instructed (entering my key in the string)

using Syncfusion.Licensing;


public partial class App : Application
{
public App()
{
//Register Syncfusion license
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
}
}


Visual Studio recognized the library Syncfusion.Licensing, as well as Syncfusion.Licensing.SyncfusionLicenseProvider.

However it's telling me Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense doesn't exist in the current context.

So, I'm stuck.

Any help would be appreciated.


1 Reply

IJ Irfana Jaffer Sadhik Syncfusion Team February 15, 2023 11:53 AM UTC

Thank you for sharing the details. We have checked the reported exception with the provided details on our end. since MainPage.xaml is the entry for the application. we request you apply the license key provider in the MainPage.Xaml.cs as follows:


However, we have attached the sample for your reference. Please try this in your end and let us know the result.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Create-a-new-PDF-document1884954302


If still you are facing an issue. we request you share the modified sample with us. So that we can assist with you further in this.


Loader.
Up arrow icon