Linked Questions

Popular Questions

Adding 3rd party controls to .NET Core WPF application

Asked by At

Section Controls, NuGet Packages, and Existing Assembly References of .NET Core 3 release notes on Support for Windows Desktop Applications states the following:

Desktop applications often have many dependencies, maybe from a control vendor, from NuGet or binaries that don’t have source any more. It’s not like all of that can be updated to .NET Core 3 quickly or maybe not even at all.

As stated above, we intend to support dependencies as-is. If you are at the Build conference, you will see Scott Hunter demo a .NET Core 3 desktop application that uses an existing 3rd-party control. We will continue testing scenarios like that to validate .NET Core 3 compatibility.

I created a WPF application targeting .NET Core 3 in VS 2019 using dotnet new wpf command, and it works fine.

However, when I add a 3rd party WPF control from NuGet (control was built targeting .NET Framework 4.6.1) I get the following error message:

Warning NU1701 Package 'Syncfusion.Shared.WPF 16.4.0.52' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v3.0'. This package may not be fully compatible with your project.

The application still builds successfully but when I attempt to run the application public MainWindow() throws :

System.Windows.Markup.XamlParseException: ''The invocation of the constructor on type 'Syncfusion.Windows.Tools.Controls.GroupBar' that matches the specified binding constraints threw an exception.' Line number '16' and line position '10'.'

Was anyone able to add a reference to a 3rd party WPF control to a WPF application targeting .NET Core 3 and if so what is the trick?

Related Questions