With either VS 2022 or VS 2022 Preview edition, I'm trying to use the Ctrl . Convert to class option. In either case, I see this error as I float over the option--I don't even need to select the option.
at the top of the screen. The full text of the exception is:
System.NullReferenceException : Object reference not set to an instance of an object.
at Microsoft.CodeAnalysis.Shared.Extensions.IAssemblySymbolExtensions.IsSameAssemblyOrHasFriendAccessTo(IAssemblySymbol assembly,IAssemblySymbol toAssembly)
at Microsoft.CodeAnalysis.Shared.Extensions.ISymbolExtensions.IsNamedTypeAccessible(INamedTypeSymbol type,ISymbol within)
at Microsoft.CodeAnalysis.Shared.Extensions.ISymbolExtensions.IsSymbolAccessibleCore(ISymbol symbol,ISymbol within,ITypeSymbol throughType,Boolean& failedThroughTypeCheck)
at Microsoft.CodeAnalysis.GenerateEqualsAndGetHashCodeFromMembers.AbstractGenerateEqualsAndGetHashCodeService.CreateGetHashCodeStatements(SyntaxGenerator factory,SyntaxGeneratorInternal generatorInternal,Compilation compilation,INamedTypeSymbol namedType,ImmutableArray`1 members)
at Microsoft.CodeAnalysis.GenerateEqualsAndGetHashCodeFromMembers.AbstractGenerateEqualsAndGetHashCodeService.CreateGetHashCodeMethod(SyntaxGenerator factory,SyntaxGeneratorInternal generatorInternal,Compilation compilation,INamedTypeSymbol namedType,ImmutableArray`1 members)
at async Microsoft.CodeAnalysis.GenerateEqualsAndGetHashCodeFromMembers.AbstractGenerateEqualsAndGetHashCodeService.GenerateGetHashCodeMethodAsync(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.ConvertAnonymousType.AbstractConvertAnonymousTypeToClassCodeRefactoringProvider`6.GenerateFinalNamedTypeAsync[TExpressionSyntax,TNameSyntax,TIdentifierNameSyntax,TObjectCreationExpressionSyntax,TAnonymousObjectCreationExpressionSyntax,TNamespaceDeclarationSyntax](<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.ConvertAnonymousType.AbstractConvertAnonymousTypeToClassCodeRefactoringProvider`6.ConvertAsync[TExpressionSyntax,TNameSyntax,TIdentifierNameSyntax,TObjectCreationExpressionSyntax,TAnonymousObjectCreationExpressionSyntax,TNamespaceDeclarationSyntax](<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetChangedSolutionAsync(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CodeActions.CodeAction.ComputeOperationsAsync(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CodeActions.CodeAction.ComputePreviewOperationsAsync(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetPreviewOperationsAsync(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.GetPreviewOperationsAsync(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.GetPreviewResultAsync(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.<>c__DisplayClass16_0.<GetPreviewAsync>b__0(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T](<Unknown Parameters>)