Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CS8032 An instance of analyzer ErrorProne.NET.* cannot be created from [...]: Could not load type 'ErrorProne.NET.*' from assembly #282

Open
n0099 opened this issue Mar 24, 2024 · 0 comments

Comments

@n0099
Copy link

n0099 commented Mar 24, 2024

With

<PackageReference PrivateAssets="all" ExcludeAssets="compile" Include="ErrorProne.NET.CoreAnalyzers" Version="0.6.1-beta.1" />
CS8032	An instance of analyzer ErrorProne.NET.AsyncAnalyzers.RedundantConfigureAwaitFalseAnalyzer cannot be created from ~\.nuget\packages\errorprone.net.coreanalyzers\0.6.1-beta.1\analyzers\dotnet\cs\ErrorProne.Net.CoreAnalyzers.dll: Could not load type 'ErrorProne.NET.AsyncAnalyzers.RedundantConfigureAwaitFalseAnalyzer' from assembly 'ErrorProne.Net.CoreAnalyzers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
System.TypeLoadException: Could not load type 'ErrorProne.NET.AsyncAnalyzers.RedundantConfigureAwaitFalseAnalyzer' from assembly 'ErrorProne.Net.CoreAnalyzers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
   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, ImmutableHashSet`1 analyzerTypeNames, Boolean& reportedError)

and many other different classes from namespace ErrorProne.NET with similar exception, downgrade to 0.1.2 will fix this, but not for ErrorProne.NET.Structs

<PackageReference PrivateAssets="all" ExcludeAssets="compile" Include="ErrorProne.NET.Structs" Version="0.1.2" />
CS8032	An instance of analyzer ErrorProne.NET.StructAnalyzers.NonReadOnlyStructPassedAsInParameterAnalyzer cannot be created from ~\.nuget\packages\errorprone.net.structs\0.1.2\analyzers\dotnet\cs\ErrorProne.Net.StructAnalyzers.dll: Could not load type 'ErrorProne.NET.StructAnalyzers.NonReadOnlyStructPassedAsInParameterAnalyzer' from assembly 'ErrorProne.Net.StructAnalyzers, Version=0.6.1.0, Culture=neutral, PublicKeyToken=null'
System.TypeLoadException: Could not load type 'ErrorProne.NET.StructAnalyzers.NonReadOnlyStructPassedAsInParameterAnalyzer' from assembly 'ErrorProne.Net.StructAnalyzers, Version=0.6.1.0, Culture=neutral, PublicKeyToken=null'.
   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, ImmutableHashSet`1 analyzerTypeNames, Boolean& reportedError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant