Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

DataGrid not working on .Net6 #4531

Closed
Closed

Description

@fatscally

Describe the bug

I tried to install the DataGrid on my .Net 6.0 app and got the following error. I leave it here in the hands of the right people :)

Severity	Code	Description	Project	File	Line	Suppression State
Error	NU1202	
Package CommunityToolkit.WinUI.UI.Controls.DataGrid 7.1.2 is not compatible with net6.0-windows10.0.17763 (.NETCoreApp,Version=v6.0). 
Package CommunityToolkit.WinUI.UI.Controls.DataGrid 7.1.2 supports: net5.0-windows10.0.18362 (.NETCoreApp,Version=v5.0)	FSM	C:\Users\r\Dropbox\F22\F22\FSM.csproj

Regression

No response

Reproducible in sample app?

  • This bug can be reproduced in the sample app.

Steps to reproduce

Create a .Net6.0 app.

Install the CommunityToolkit.WinUI.UI.Controls.DataGrid 7.1.2

The install will fail because it is not compatible with .Net 6.0

Expected behavior

I was thinking it would work seamlessly with .Net 6.0

Screenshots

No response

Windows Build Number

  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

No response

App minimum and target SDK version

  • Windows 10, version 1809 (Build 17763)
  • Windows 10, version 1903 (Build 18362)
  • Windows 10, version 1909 (Build 18363)
  • Windows 10, version 2004 (Build 19041)
  • Other (specify)

Other SDK version

No response

Visual Studio Version

2022

Visual Studio Build Number

17.1.4

Device form factor

No response

Nuget packages

CommunityToolkit.WinUI.UI.Controls.DataGrid 7.1.2

Additional context

No response

Help us help you

No.

Activity

  1. added
    bug 🐛An unexpected issue that highlights incorrect behavior
    on Apr 14, 2022
  2. michael-hawker commented on Apr 15, 2022

    @michael-hawker
    Member

    @fatscally the min version of the toolkit currently is -windows10.0.18362, have you tried using net6.0-windows10.0.18362 instead?

  3. fatscally commented on Apr 15, 2022

    @fatscally
    Author

    @fatscally the min version of the toolkit currently is -windows10.0.18362, have you tried using net6.0-windows10.0.18362 instead?

    Hello Michael!

    I have spent the last hour or so trying every different configuration based on your suggestion.
    I've tried Microsoft.Toolkit.Uwp.UI.Controls.DataGrid and CommunityToolkit.WinUI.UI.Controls.DataGrid.

    I have played about with the Target OS version. Everything builds and runs fine until I try to use the controls:DataGrid
    Screenshot 2022-04-15 104028

    The Microsoft version does not install:
    Package Microsoft.Toolkit.Uwp.UI.Controls.DataGrid 7.1.2 is not compatible with net6.0-windows10.0.18362 (.NETCoreApp,Version=v6.0). Package Microsoft.Toolkit.Uwp.UI.Controls.DataGrid 7.1.2 supports: uap10.0.17763 (UAP,Version=v10.0.17763

    And if I change it to 10.0.17763 it will not install.

    Package Microsoft.Toolkit.Uwp.UI.Controls.DataGrid 7.1.2 is not compatible with net6.0-windows10.0.17763 (.NETCoreApp,Version=v6.0). Package Microsoft.Toolkit.Uwp.UI.Controls.DataGrid 7.1.2 supports: uap10.0.17763 (UAP,Version=v10.0.17763)

    I am wondering do I need to download and compile the source locally? It's not something I've done before. I'm more of a plain old business app developer.

  4. fatscally commented on Apr 15, 2022

    @fatscally
    Author

    Seems to me it's not working anywhere!...

    I opened VS2022 17.1.4
    Created new WPF Application. Framework .Net5.0 (current)
    Right click on project and select Properties.
    Target OS version: 10.0.17763.0

    Open Nuget manager.

    1. Try install Microsoft.Toolkit.Uwp.UI.Controls.DataGrid Latest Stable 7.1.2
      Error:
      `Package Microsoft.Toolkit.Uwp.UI.Controls.DataGrid 7.1.2 is not compatible with net5.0-windows10.0.17763 (.NETCoreApp,Version=v5.0).
      Package Microsoft.Toolkit.Uwp.UI.Controls.DataGrid 7.1.2 supports: uap10.0.17763 (UAP,Version=v10.0.17763)

    2. Try install CommunityToolkit.WinUI.UI.Controls.DataGrid

    Error:

    CommunityToolkit.WinUI.UI.Controls.DataGrid 7.1.2 is not compatible with net5.0-windows10.0.17763 (.NETCoreApp,Version=v5.0). 
    Package CommunityToolkit.WinUI.UI.Controls.DataGrid 7.1.2 supports: net5.0-windows10.0.18362 (.NETCoreApp,Version=v5.0)	
    

    So I change the build Target to 10.0.18362 an it will install.

    I add the reference in the xaml:
    xmlns:controls="clr-namespace:CommunityToolkit.WinUI.UI.Controls;assembly=CommunityToolkit.WinUI.UI.Controls.DataGrid"

    <Grid>
        <controls:DataGrid x:Name="MrGridFace">
        </controls:DataGrid>
    </Grid>
    
    Now I get the errors 
    A value of type 'DataGrid' cannot be added to a collection or dictionary of type 'UIElementCollection'
    The specified value cannot be assigned to the collection. The following type was expected: "UIElement".
    

    Screenshot 2022-04-15 131146

  5. michael-hawker commented on Apr 15, 2022

    @michael-hawker
    Member

    @fatscally these controls are for UWP or WinUI 3, they don't work in a WPF project directly unless you use XAML Islands.

    You can read more about WinUI 3 here and more about using the Toolkit with WinUI 3 here.

  6. fatscally commented on Apr 16, 2022

    @fatscally
    Author

    Yup! That explains it. I had my suspicions. I haven't gone down the WinUI rabbit hole yet.
    Right so let's delete this "bug"! :)

  7. locked and limited conversation to collaborators on Apr 18, 2022
  8. converted this issue into a discussion #4535 on Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions