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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to resolve ambiguous type reference exception?

Platform: WinRT |
Control: SfSpreadsheet
Tags: exception

Consider you are declaring control or class in xaml with same name present in two different dlls. And also consider both the dlls are reference to your project and declared using common namespace in xaml. In this case, you will get ambiguous type reference exception when running the application.


For example,

In the below code snippet GridCell style is declared and it is present in both Syncfusion.SfGrid.WPF dll and Syncfusion.Grid.WPF dll. Also GridCell referred from common namespace http://schemas.Syncfusion.com/wpf. If you have both Syncfusion.SfGrid.WPF and Syncfusion.Grid.WPF as reference, then when running application you will get ambiguous type reference exception.



It is because both Syncfusion.SfGrid.WPF and Syncfusion.Grid.WPF dlls are present in common namespace http://schemas.Syncfusion.com/wpf. Also GridCell control is present in both the dlls with same name, it leads to ambiguous type reference exception if you reference http://schemas.Syncfusion.com/wpf to your project.


You can overcome this problem by two ways,

Way 1: Based on the components used in your application you can add only required dlls. For example if you use SfDataGrid in your code, you don’t need to add Syncfusion.Grid.WPF or Syncfusion.GridCommon.WPF dll reference.


Way 2: If you are in need to refer both dlls in your project. Then you can declare the namespace for GridCell explicitly by specifying assembly as below,







You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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