'Syncfusion.SfChart' is a namespace but is used like a type

After installing Syncfusion.SfChart using the standard Visual Studio 2017 NuGet interface into a Xamarin.Forms Shared Project (all three platform projects: Android, iOS, and UWP), I added a simple line to my vanilla MainPage.xaml.cs:

public MainPage() {
...
     var x = new Syncfusion.SfChart();
...
}

Although Intellisense autocompleted it for me, I get Ye Olde Red Squigglies (shown as a boring red underline above) with the following error:
'Syncfusion.SfChart' is a namespace but is used like a type

If I attempt to build anyhow I get the same thing but with a helpful error code (as expected):
error CS0118: 'Syncfusion.SfChart' is a namespace but is used like a type

I'm only trying to build and make Android work first, and References appear to be in order but I even went ahead and added the extra code for iOS and UWP as directed.

But no dice.  Could this be a version thing?  I have a Community License for Essential Studio, but it is version 14.3.0 and I realize that's not the latest version.

5 Replies

MK Muneesh Kumar G Syncfusion Team February 10, 2018 10:00 AM UTC

Hi John Tolle, 
 
Thanks for using Syncfusion products. 
 
We would like to let you know that it works on all the versions. Could you please make sure that all the assemblies which is mentioned in this guide are properly added in your Android, iOS and UWP projects? 
 
Also, we have created a simple shared project for your reference, please download the sample from below location and let us know if it works properly at your end. 
 
 
Thanks, 
Muneesh Kumar G. 



JT John Tolle February 10, 2018 05:22 PM UTC

Thanks, Muneesh.  Your project built and ran just fine.  I cannot tell what the difference is, because those references are in place in my projects and I acquired the Syncfusion assemblies via the normal NuGet process.


LR Lakshmi Radha Krishnan Syncfusion Team February 13, 2018 05:03 AM UTC

 
Hi John, 
 
Thank you for the update. 
  
Could you please make sure all the Syncfusion assemblies which are added in our sample are referred in your application? 
  
Note : You should add Syncfusion.Xamarin.SfChart nuget package in all three platforms (Android, iOS and UWP). You can refer the assembly dependency from below user guide. 
  
 
Regards, 
Lakshmi R. 
  
 
 
  
 
 




JT John Tolle February 13, 2018 05:08 PM UTC

Lakshmi, perhaps you missed one of my replies which confirms that I did do all those steps.

I was able to get this to work in a project I did a year ago, but there is one difference.  The one that works is a PCL project and the one that doesn't is a Shared project.  Is there anything special I need to do with a Shared vs. PCL project?


DV Divya Venkatesan Syncfusion Team February 14, 2018 12:45 PM UTC

Hi John,

There nothing special to be done for Shared project than PCL project. The dependencies which are mentioned in below page should be added in respective projects, this is just enough to include the SfChart assemblies to your shared project.

https://help.syncfusion.com/xamarin/introduction/control-dependencies

Regards,
Divya Venkatesan


Loader.
Up arrow icon