Sometimes I'd get Exceptions of Refactoring Providers being disabled after an Exception, but only in WPF Projects (Target Framework .NET 4.6 on VS 2017 Community 15.7.1 in case it matters). Surprisingly, the error happens while invoking the Lightbulb menu in a C# code-behind file (not inside a XAML file; albeit the code-behind for a XAML control).
One such stack is this one (varies, but always ends up in that method):
C#System.TypeLoadException : Method 'get_IsSerializable' in type 'DevExpress.CodeAnalysis.Xaml.Symbols.IntrinsicTypeSymbol' from assembly 'DevExpress.CodeAnalysis.Xaml, Version=17.2.8.0, Culture=neutral, PublicKeyToken=79868b8147b5eae4' does not have an implementation.
at DevExpress.CodeAnalysis.Xaml.XamlCompilation.GetXamlNamespaceSymbol(String xmlNamespace,ImmutableDictionary`2 map)
at DevExpress.CodeAnalysis.Xaml.XamlCompilation.GetAllXamlNamespaces(CancellationToken cancellationToken)
at async DevExpress.CodeAnalysis.Xaml.XamlCompilation.InitializeAsync(<Unknown Parameters>)
at async DevExpress.CodeAnalysis.Xaml.XamlProject.GetCompilationAsync(<Unknown Parameters>)
at async DevExpress.CodeAnalysis.Xaml.XamlDocument.GetSemanticModelAsync(<Unknown Parameters>)
at async DevExpress.CodeAnalysis.Xaml.Features.Navigations.BaseXamlNavigationProvider.FindAllXamlReferencesInProject(<Unknown Parameters>)
at async DevExpress.CodeAnalysis.CSharp.Refactorings.RemoveUnusedMemberRefactoring.IsCorrectRefernecesAsync(<Unknown Parameters>)
at async DevExpress.CodeAnalysis.CSharp.Refactorings.RemoveUnusedMemberRefactoring.IsAvailableInternal(<Unknown Parameters>)
at async DevExpress.CodeAnalysis.Refactorings.RefactoringProvider.GetAvailableRefactorings(<Unknown Parameters>)
at async DevExpress.CodeAnalysis.Refactorings.RefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>)
Usually works if I just re-enable it and continue working, but still something that should probably be looked at.
Hi Emanuel,
Thank you for the report. I was able to reproduce this issue and passed it to our developers for further research. We will let you know once it gets fixed.