Hi Matanya,
Thank you for contacting the Syncfusion support.
Based on the provided information, we understood that the when running the some of the dashboard sample, you are facing the errors “The name 'DemoCommon' does not exist”. So, can you please paste the following code in the App.Xaml.CS file in the sample.
public static class DemoCommon
{
/// <summary>
/// Helper method to find a syncfusion license key from the Common folder
/// </summary>
/// <param name="fileName">File name of the syncfusion license key</param>
/// <returns></returns>
public static string FindLicenseKey() { int levelsToCheck = 12; string filePath =@"Common\SyncfusionLicense.txt"; string rootPath = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().CodeBase.Replace(@"","")); for (int n = 0; n < levelsToCheck; n++) { string fileDataPath = System.IO.Path.Combine(rootPath, filePath); if (System.IO.File.Exists(fileDataPath))return File.ReadAllText(fileDataPath, Encoding.UTF8); DirectoryInfo rootDirectory = Directory.GetParent(rootPath); if (rootDirectory == null) break; rootPath = rootDirectory.FullName; } return string.Empty; }
} |
Example –
namespace PropertyGridConfigurationDemo
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public App()
{
SyncfusionLicenseProvider.RegisterLicense(DemoCommon.FindLicenseKey());
}
}
public static class DemoCommon
{
/// <summary>
/// Helper method to find a syncfusion license key from the Common folder
/// </summary>
/// <param name="fileName">File name of the syncfusion license key</param>
/// <returns></returns>
public static string FindLicenseKey() { int levelsToCheck = 12; string filePath =@"Common\SyncfusionLicense.txt"; string rootPath = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().CodeBase.Replace(@"","")); for (int n = 0; n < levelsToCheck; n++) { string fileDataPath = System.IO.Path.Combine(rootPath, filePath); if (System.IO.File.Exists(fileDataPath))return File.ReadAllText(fileDataPath, Encoding.UTF8); DirectoryInfo rootDirectory = Directory.GetParent(rootPath); if (rootDirectory == null) break; rootPath = rootDirectory.FullName; } return string.Empty; }
}
} |
Please let us know if by placing the code resolves the issue on your side. If not, please specify about the currently installed Syncfusion Essential Build details (Build Platforms and their versions) in your machine.
Regards,
Subburaj Pandian V