CommunityToolkit / dotnet

.NET Community Toolkit is a collection of helpers and APIs that work for all .NET developers and are agnostic of any specific UI platform. The toolkit is maintained and published by Microsoft, and part of the .NET Foundation.
https://docs.microsoft.com/dotnet/communitytoolkit/?WT.mc_id=dotnet-0000-bramin
Other
2.99k stars 294 forks source link

WinUI 3.0 with MVVM always has errors: MVVMTK0008, MVVMTK0020, MVVMTK0027 and MVVMTK0028 #716

Closed amdo1148 closed 1 year ago

amdo1148 commented 1 year ago

Describe the bug

I created a new WinUI 3.0 sample project then installed CommunityToolkit.Mvvm V8.2.0. I haven't start coding but it already shows me 4 errors:

It also shows 3 warnings:

Regression

CommunityToolkit.Mvvm V7.0.2

Steps to reproduce

1.Create a new WinUI 3.0 project like named: sampleApp
2.Update WindowsAppSDK and Windows.SDK.BuildTools to the lastest version
3.Install CommunityToolkit.Mvvm version 8.2.0

Click on the CommunityToolkit.Mvvm.SourceGenerators under project Dependencies/Analyzers, and you will see those errors and warnings

Expected behavior

It's should NOT show those errors and warnings in a new winui 3.0 project.

Screenshots

No response

IDE and version

VS 2022

IDE version

Version 17.6.2

Nuget packages

Nuget package version(s)

8.2.0

Additional context

Here is my project configs:

WinExe net6.0-windows10.0.19041.0 10.0.17763.0 SampleApp app.manifest x86;x64;ARM64 win10-x86;win10-x64;win10-arm64 win10-$(Platform).pubxml true true

Help us help you

Yes, I'd like to be assigned to work on this item

Sergio0694 commented 1 year ago

If I understand correctly what you mean (the errors/warnings being visible under Project > Dependencies > Analyzers > CommunityToolkit.Mvvm), those are not errors, it's just the UI that Visual Studio has to show you which diagnostics analyzers are loaded from a given project (so you can also configure their severity form there, if you wanted). But those are not actually being produced. You can verify this by building the project, you should see no warnings in the output window 🙂

amdo1148 commented 1 year ago

Thank you for your explanation and much appreciated for your help.