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.96k stars 292 forks source link

CS8032 An instance of analyzer CommunityToolkit.Mvvm.SourceGenerators.AutoPropertyWithFieldTargetedObservablePropertyAttributeAnalyzer cannot be created #789

Open myokeeh opened 10 months ago

myokeeh commented 10 months ago

Describe the bug

I have a UWP app with CommunityToolkit.Mvvm 8.2.2 and getting this warning. Where do I start addressing it?

Severity    Code    Description Project File    Line    Suppression State   Detail Description
Warning CS8032  An instance of analyzer CommunityToolkit.Mvvm.SourceGenerators.AutoPropertyWithFieldTargetedObservablePropertyAttributeAnalyzer cannot be created from C:\Users\User\.nuget\packages\communitytoolkit.mvvm\8.2.2\analyzers\dotnet\roslyn4.3\cs\CommunityToolkit.Mvvm.SourceGenerators.dll: Could not load type 'CommunityToolkit.Mvvm.SourceGenerators.AutoPropertyWithFieldTargetedObservablePropertyAttributeAnalyzer' from assembly 'CommunityToolkit.Mvvm.SourceGenerators, Version=8.2.0.0, Culture=neutral, PublicKeyToken=4aff67a105548ee2'..    IPAPP8WTS   C:\Users\Carlo\.nuget\packages\communitytoolkit.mvvm\8.2.2\analyzers\dotnet\roslyn4.3\cs\CommunityToolkit.Mvvm.SourceGenerators.dll 1   Active  System.TypeLoadException: Could not load type 'CommunityToolkit.Mvvm.SourceGenerators.AutoPropertyWithFieldTargetedObservablePropertyAttributeAnalyzer' from assembly 'CommunityToolkit.Mvvm.SourceGenerators, Version=8.2.0.0, Culture=neutral, PublicKeyToken=4aff67a105548ee2'.
   at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)
   at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
   at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.GetAnalyzersForTypeNames(Assembly analyzerAssembly, IEnumerable`1 analyzerTypeNames, Boolean& reportedError)

Regression

Not sure

Steps to reproduce

I don't have any steps to reproduce. This is a warning that VS is showing.

Expected behavior

Clearer warning or description that is actionable.

Screenshots

No response

IDE and version

VS 2022

IDE version

17.7.6

Nuget packages

Nuget package version(s)

8.2.2

Additional context

No response

Help us help you

No, just wanted to report this

TonyLugg commented 10 months ago

Same issue here

myokeeh commented 10 months ago

@Sergio0694, any insight?

darcome commented 10 months ago

I have the same issue just upgrading the nuget package through the "Manage nuget packages" interface in vs2022 and no other change.

Forgot to mention that I have upgraded from 8.2.1 to 8.2.2.

wbokkers commented 9 months ago

Same here.

stivoberlin commented 8 months ago

same here