If this is a report about a bug in an analyzer, please include the diagnostic ID and message if possible (e.g. "IDE0030: Use coalesce expression").
Expected Behavior:
No yellow bars.
Actual Behavior:
Getting an exception in VS (this is one of many that I get, starting to file issues that I'm having):
System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeAssembly.get_DefinedTypes()
at System.Composition.Hosting.ContainerConfiguration.<>c.b__16_0(Assembly a)
at System.Linq.Enumerable.d__172.MoveNext() at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor(IEnumerable1 types,AttributedModelProvider attributeContext)
at System.Composition.Hosting.ContainerConfiguration.CreateContainer()
at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices.MefHostExportProvider.Create(String languageName)
at System.Runtime.CompilerServices.ConditionalWeakTable2.GetValue(TKey key,CreateValueCallback createValueCallback) at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices..ctor(HostLanguageServices hostLanguageServices) at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices.Create(HostLanguageServices hostLanguageServices) at System.Runtime.CompilerServices.ConditionalWeakTable2.GetValue(TKey key,CreateValueCallback createValueCallback)
at Microsoft.CodeAnalysis.Shared.Extensions.ProjectExtensions.GetExtendedLanguageServices(Project project)
at Microsoft.CodeAnalysis.RemoveUnusedParametersAndValues.AbstractRemoveUnusedValuesCodeFixProvider11.IsForEachIterationVariableDiagnostic(Diagnostic diagnostic,Document document,CancellationToken cancellationToken) at async Microsoft.CodeAnalysis.RemoveUnusedParametersAndValues.AbstractRemoveUnusedValuesCodeFixProvider11.RegisterCodeFixesAsync[TExpressionSyntax,TStatementSyntax,TBlockSyntax,TExpressionStatementSyntax,TLocalDeclarationStatementSyntax,TVariableDeclaratorSyntax,TForEachStatementSyntax,TSwitchCaseBlockSyntax,TSwitchCaseLabelOrClauseSyntax,TCatchStatementSyntax,TCatchBlockSyntax]()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CodeFixes.CodeFixService.GetCodeFixesAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T]()
Version Used: Microsoft Visual Studio Enterprise 2022 (64-bit) - Int Preview Version 17.12.0 Preview 2.0 [35228.322.main]
Steps to Reproduce:
A minimal repro, with source-code provided, is ideal. Using sharplab is preferred for compiler/language issues whenever possible.
Diagnostic Id: CSharpRemoveUnusedValuesCodeFixProvider
If this is a report about a bug in an analyzer, please include the diagnostic ID and message if possible (e.g.
"IDE0030: Use coalesce expression"
).Expected Behavior:
No yellow bars.
Actual Behavior:
Getting an exception in VS (this is one of many that I get, starting to file issues that I'm having):
System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.RuntimeAssembly.get_DefinedTypes() at System.Composition.Hosting.ContainerConfiguration.<>c.b__16_0(Assembly a)
at System.Linq.Enumerable.d__17)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CodeFixes.CodeFixService.GetCodeFixesAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T]()
2.MoveNext() at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor(IEnumerable
1 types,AttributedModelProvider attributeContext) at System.Composition.Hosting.ContainerConfiguration.CreateContainer() at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices.MefHostExportProvider.Create(String languageName) at System.Runtime.CompilerServices.ConditionalWeakTable2.GetValue(TKey key,CreateValueCallback createValueCallback) at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices..ctor(HostLanguageServices hostLanguageServices) at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices.Create(HostLanguageServices hostLanguageServices) at System.Runtime.CompilerServices.ConditionalWeakTable
2.GetValue(TKey key,CreateValueCallback createValueCallback) at Microsoft.CodeAnalysis.Shared.Extensions.ProjectExtensions.GetExtendedLanguageServices(Project project) at Microsoft.CodeAnalysis.RemoveUnusedParametersAndValues.AbstractRemoveUnusedValuesCodeFixProvider11.IsForEachIterationVariableDiagnostic(Diagnostic diagnostic,Document document,CancellationToken cancellationToken) at async Microsoft.CodeAnalysis.RemoveUnusedParametersAndValues.AbstractRemoveUnusedValuesCodeFixProvider
11.RegisterCodeFixesAsync[TExpressionSyntax,TStatementSyntax,TBlockSyntax,TExpressionStatementSyntax,TLocalDeclarationStatementSyntax,TVariableDeclaratorSyntax,TForEachStatementSyntax,TSwitchCaseBlockSyntax,TSwitchCaseLabelOrClauseSyntax,TCatchStatementSyntax,TCatchBlockSyntax](