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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Error compiling demo on local v17.1.0.47

Thread ID:

Created:

Updated:

Platform:

Replies:

146721 Aug 15,2019 04:24 PM UTC Sep 19,2019 11:08 AM UTC WPF 3
loading
Tags: General
Matanya Cohen
Asked On August 15, 2019 04:24 PM UTC

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

Subburaj Pandian Veluchamy [Syncfusion]
Replied On 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  


Matanya Cohen
Replied On 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?





Vijayalakshmi Roopkumar [Syncfusion]
Replied On 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.  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon