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
close icon

Error compiling demo on local v17.1.0.47

I have Community lic.
I download install Essential WPF. I open the Panel and try: 'Run Local Demos'
For some demos, I got (VS 2017):
Severity Code Description Project File Line Suppression State
Error CS0103 The name 'DemoCommon' does not exist in the current context PropertyGridConfiguration_2017 C:\Users\Public\Documents\Syncfusion\WPF\17.1.0.47\Tools.WPF\Samples\PropertyGrid\Getting Started\CS\App.xaml.cs 25 Active
For another demo I got:
Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'DemoCommon' does not exist in the namespace 'Syncfusion.Licensing' (are you missing an assembly reference?) ExpenseAnalysisDemo_2012 C:\Users\Public\Documents\Syncfusion\WPF\17.1.0.47\Showcase\ExpenseAnalysisDemo\CS\App.xaml.cs 24 Active

3 Replies

SP Subburaj Pandian Veluchamy Syncfusion Team August 19, 2019 12:46 PM UTC

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 == nullbreak; 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 == nullbreak; 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  



MC Matanya Cohen September 18, 2019 06:39 AM UTC

Seem somthing wrong in follow code:

Assembly.GetEntryAssembly().CodeBase.Replace(@"","")

Exception thrown: 'System.ArgumentException' in mscorlib.dll
An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll
String cannot be of zero length.

System.ArgumentException: 'String cannot be of zero length.
Parameter name: oldValue'

Ok, I try put the lic key directly:

Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("...")

Instead add "FindLicenseKey"

But still need do it for every Demo project. dont it?






VR Vijayalakshmi Roopkumar Syncfusion Team September 19, 2019 11:08 AM UTC

 Hi Matanya

We suggest you to replace the above code snippets only in mentioned samples not for all the samples. Or else please replace the attached App.xaml.cs in the below mentioned location. In the attached App.xaml.cs file, we have modified the license changes as per our previous update of PropertyGrid sample. Similary you need to replace for other error reproducing sample.

License related file: https://www.syncfusion.com/downloads/support/forum/146721/ze/APPXAM~11432991911 

Sample Location: C:\Users\Public\Documents\Syncfusion\WPF\17.1.0.47\Tools.WPF\Samples\PropertyGrid\Getting Started\CS\App.xaml.cs

Please done the above changes and let us know if it helps.

Regards
Vijayalakshmi V.R.  


Loader.
Live Chat Icon For mobile
Up arrow icon