Bug Report T633995
Visible to All Users

TypeLoadException in XamlCompilation during work in code-behind file

created 7 years ago

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.

Comments (1)
PW PW
Przemyslaw Wlodarczak (DevExpress) 7 years ago

    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.

    Answers approved by DevExpress Support

    created 7 years ago

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.