dotnet icon indicating copy to clipboard operation
dotnet copied to clipboard

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

Open myokeeh opened this issue 2 years ago • 5 comments

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

  • [ ] CommunityToolkit.Common
  • [ ] CommunityToolkit.Diagnostics
  • [ ] CommunityToolkit.HighPerformance
  • [X] CommunityToolkit.Mvvm (aka MVVM Toolkit)

Nuget package version(s)

8.2.2

Additional context

No response

Help us help you

No, just wanted to report this

myokeeh avatar Nov 06 '23 05:11 myokeeh

Same issue here

TonyLugg avatar Nov 06 '23 14:11 TonyLugg

@Sergio0694, any insight?

myokeeh avatar Nov 09 '23 05:11 myokeeh

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.

darcome avatar Nov 15 '23 07:11 darcome

Same here.

wbokkers avatar Dec 12 '23 09:12 wbokkers

same here

stivoberlin avatar Jan 15 '24 18:01 stivoberlin