Ticket T497988
Visible to All Users

DeclareProvider throws null reference exception

created 8 years ago

Visual Studio 2017 version 15.00+26228.10

System.NullReferenceException : Object reference not set to an instance of an object.
   at async DevExpress.CodeAnalysis.VisualBasic.CodeDeclare.MemberDeclarator.GetInsertionInfo(<Unknown Parameters>)
   at async DevExpress.CodeAnalysis.VisualBasic.CodeDeclare.MemberDeclarator.GetInsertionInfos(<Unknown Parameters>)
   at async DevExpress.CodeAnalysis.VisualBasic.CodeDeclare.MemberDeclarator.GetNodeReplacements(<Unknown Parameters>)
   at async DevExpress.CodeAnalysis.VisualBasic.CodeDeclare.ElementDeclarator.Execute(<Unknown Parameters>)
   at async DevExpress.CodeAnalysis.VisualBasic.CodeDeclare.DeclareMemberRefactoring.Execute(<Unknown Parameters>)
   at async DevExpress.CodeAnalysis.VisualBasic.CodeDeclare.DeclareRefactoring.ApplyChangeManager(<Unknown Parameters>)
   at async DevExpress.CodeAnalysis.TargetPicker.TargetPickerRegistrator.DoRegistration(<Unknown Parameters>)
   at async DevExpress.CodeAnalysis.TargetPicker.TargetPickerRefactoringProvider.DoRefactoringRegistration(<Unknown Parameters>)
   at async DevExpress.CodeAnalysis.Refactorings.RefactoringProvider.RegisterRefactoring(<Unknown Parameters>)
   at async DevExpress.CodeAnalysis.Refactorings.RefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>)

I see other links with the same problem for previous version of VS:
https://www.devexpress.com/Support/Center/Question/Details/T478207

https://www.devexpress.com/Support/Center/Question/Details/T484513Also, getting this error:
System.NullReferenceException : Object reference not set to an instance of an object.
   at async DevExpress.CodeAnalysis.Refactorings.RefactoringAction.IsAvailable(<Unknown Parameters>)
   at async DevExpress.CodeAnalysis.Refactorings.RefactoringProvider.RefactoringIsAvailable(<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>)

Answers approved by DevExpress Support

created 8 years ago (modified 8 years ago)

Hi Edhy, we have recently fixed a similar issue.  I suggest you install the build containing the hotfix using this link: CodeRush.Roslyn-16.2.6.17074.vsix and let us know your result.

    Show previous comments (1)
    DevExpress Support Team 8 years ago

      I am happy to hear that the hotfix helped to solve the issue. Should you have any questions regarding our products, do not hesitate to ask

        Hi,
        I am so sorry, but started getting this error again with CR for Roslyn v16.2.7

        Here is the exception.

        Visual Basic
        System.NullReferenceException : Object reference not set to an instance of an object. at async DevExpress.CodeAnalysis.VisualBasic.CodeDeclare.ElementDeclarator.GetExpressionTypeSyntax(<Unknown Parameters>) at async DevExpress.CodeAnalysis.VisualBasic.CodeDeclare.ElementDeclarator.ArgumentToParameter(<Unknown Parameters>) at async DevExpress.CodeAnalysis.VisualBasic.CodeDeclare.ElementDeclarator.GetParameterListFromArguments(<Unknown Parameters>) at async DevExpress.CodeAnalysis.VisualBasic.CodeDeclare.ElementDeclarator.GetParametersFromArguments(<Unknown Parameters>) at async DevExpress.CodeAnalysis.VisualBasic.CodeDeclare.MethodDeclarator.RegisterForMethodReference(<Unknown Parameters>) at async DevExpress.CodeAnalysis.VisualBasic.CodeDeclare.MethodDeclarator.RegisterNodeDeclarations(<Unknown Parameters>) at async DevExpress.CodeAnalysis.VisualBasic.CodeDeclare.MemberDeclarator.GetNodeReplacements(<Unknown Parameters>) at async DevExpress.CodeAnalysis.VisualBasic.CodeDeclare.ElementDeclarator.Execute(<Unknown Parameters>) at async DevExpress.CodeAnalysis.VisualBasic.CodeDeclare.DeclareMemberRefactoring.Execute(<Unknown Parameters>) at async DevExpress.CodeAnalysis.VisualBasic.CodeDeclare.DeclareRefactoring.ApplyChangeManager(<Unknown Parameters>) at async DevExpress.CodeAnalysis.TargetPicker.TargetPickerRegistrator.DoRegistration(<Unknown Parameters>) at async DevExpress.CodeAnalysis.TargetPicker.TargetPickerRefactoringProvider.DoRefactoringRegistration(<Unknown Parameters>) at async DevExpress.CodeAnalysis.Refactorings.RefactoringProvider.RegisterRefactoring(<Unknown Parameters>) at async DevExpress.CodeAnalysis.Refactorings.RefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>) at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>)
        DevExpress Support Team 8 years ago

          Hi Edhy,

          It seems to be a different problem with the DeclareProvider. To process it in a more efficient manner, I've created a separate ticket on your behalf (DeclareProvider throws an exception in VB).
          It has been placed in our processing queue and will be answered shortly.

          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.