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

How to resolve ambiguous type reference 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.

XAML

 

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.

Solution

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,

xmlns:Syncfusion=”clr-namespace:Syncfusion.UI.Xaml.Grid;assembly=Syncfusion.SfGrid.WPF”

XAML

 

 

 

 

Article ID: Published Date: Last Revised Date: Platform: Control:
5711 11/17/2015 11/17/2015 WPF GridTreeControl
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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