Upgrading dotnet ''GridCell' TargetType does not match type of element 'GridCell'.'" when upgrading from .NET 4.6 to .NET 4.6.1 or higher

Currently using the following namespaces in the XAML:

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

xmlns:Syncfusion="http://schemas.syncfusion.com/wpf"


Currently installed nuget packages:

  • Syncfusion.Compression.Base 19.2.0.44
  • Syncfusion.Licensing 19.2.0.44
  • Syncfusion.Pdf.Wpf 19.2.0.44
  • Syncfusion.Xamarin.Core 18.2.0.45


Is there something glaringly obvious I am missing? Apologies I am a bit new to refactoring projects.


Any advice would be more than welcome.

Thank you in advance :)

Zeb


2 Replies

DD Dhivyabharathi Dakshinamurthy Syncfusion Team August 24, 2023 02:48 PM UTC

Hi Zeb,


The exception you reported arises due to a conflict with the "GridCell" class that exists in both the Syncfusion.SfGrid.WPF and Syncfusion.Grid.WPF DLLs. This conflict leads to an exception when you add the reference http://schemas.Syncfusion.com/wpf in your project.


To fix this issue, you can explicitly declare the namespace by specifying the assembly in the following way:


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

 


For more information related to ambiguous type reference exceptions, please refer to the below knowledge base documentation link,


KB Link: 
https://www.syncfusion.com/kb/5712/how-to-resolve-ambiguous-type-reference-exception


Regards,

DhivyaBharathi Dakshinamurthy



ZE Zebedee August 24, 2023 04:28 PM UTC

Thank you so much for this response. It has resolved the issue.

Turns out a lot of the code has been referencing Syncfusion:GridCell rather than sfgrid:GridCell hence the confusion.


Thank you again :)

Zeb


Loader.
Up arrow icon