Ticket T877993
Visible to All Users

Constant CodeRush exceptions

created 5 years ago (modified 5 years ago)

I am getting CodeRush Exceptions constantly

I re-enable and they come back

Happens when I select code and hit copy, or space to blank or even just select code, it appears random

Code
System.NullReferenceException : Object reference not set to an instance of an object. at async Microsoft.CodeAnalysis.Shared.Extensions.DocumentExtensions.GetNamingRulesAsync(<Unknown Parameters>) at async Microsoft.CodeAnalysis.GenerateConstructorFromMembers.AbstractGenerateConstructorFromMembersCodeRefactoringProvider.State.TryInitializeAsync(<Unknown Parameters>) at async Microsoft.CodeAnalysis.GenerateConstructorFromMembers.AbstractGenerateConstructorFromMembersCodeRefactoringProvider.State.TryGenerateAsync(<Unknown Parameters>) at async Microsoft.CodeAnalysis.GenerateConstructorFromMembers.AbstractGenerateConstructorFromMembersCodeRefactoringProvider.GenerateConstructorFromMembersAsync(<Unknown Parameters>) at async Microsoft.CodeAnalysis.GenerateConstructorFromMembers.AbstractGenerateConstructorFromMembersCodeRefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>) at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>) at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject) System.NullReferenceException : Object reference not set to an instance of an object. at Microsoft.CodeAnalysis.CSharp.ExtractMethod.CSharpMethodExtractor.CSharpCodeGenerator.GenerateMethodNameFromUserPreference() at Microsoft.CodeAnalysis.CSharp.ExtractMethod.CSharpMethodExtractor.CSharpCodeGenerator.GenerateMethodNameForStatementGenerators() at Microsoft.CodeAnalysis.CSharp.ExtractMethod.CSharpMethodExtractor.CSharpCodeGenerator.SingleStatementCodeGenerator.CreateMethodName() at Microsoft.CodeAnalysis.CSharp.ExtractMethod.CSharpMethodExtractor.CSharpCodeGenerator..ctor(InsertionPoint insertionPoint,SelectionResult selectionResult,AnalyzerResult analyzerResult,OptionSet options,Boolean localFunction) at Microsoft.CodeAnalysis.CSharp.ExtractMethod.CSharpMethodExtractor.CSharpCodeGenerator.Create(InsertionPoint insertionPoint,SelectionResult selectionResult,AnalyzerResult analyzerResult,OptionSet options,Boolean localFunction) at Microsoft.CodeAnalysis.CSharp.ExtractMethod.CSharpMethodExtractor.GenerateCodeAsync(InsertionPoint insertionPoint,SelectionResult selectionResult,AnalyzerResult analyzeResult,OptionSet options,CancellationToken cancellationToken) at async Microsoft.CodeAnalysis.ExtractMethod.MethodExtractor.ExtractMethodAsync(<Unknown Parameters>) at async Microsoft.CodeAnalysis.ExtractMethod.AbstractExtractMethodService`3.ExtractMethodAsync[TValidator,TExtractor,TResult](<Unknown Parameters>) at async Microsoft.CodeAnalysis.CodeRefactorings.ExtractMethod.ExtractMethodCodeRefactoringProvider.ExtractLocalFunction(<Unknown Parameters>) at async Microsoft.CodeAnalysis.CodeRefactorings.ExtractMethod.ExtractMethodCodeRefactoringProvider.GetCodeActionsAsync(<Unknown Parameters>) at async Microsoft.CodeAnalysis.CodeRefactorings.ExtractMethod.ExtractMethodCodeRefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>) at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>) at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
Comments (1)
DL DL
Darren Lawrence 5 years ago

    Answers approved by DevExpress Support

    created 5 years ago

    Hello Tim,

    Thank you for contacting us and providing a screencast.

    The "Extract Method" code action is a built-in Visual Studio feature.
    You will also notice that there are no "DevExpress.CodeRush" frames in the provided stack traces.
    So, we cannot influence the behavior of this feature.

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

        Yes, CodeRush menu items have icons as in the screencast attached.

        J J
        Joseph Krauss Jr 5 years ago

          I get a similar error. If I uninstall coderush the error stops. Not sure why the stack trace doesn't include any reference to coderush, but the error certainly starts and stops based on if its installed and running. I have VS 2019 (Version 16.5.5) with the latest version of DevExpress Coderush v20.1.3

          Clipboard-File-1.png

          System.NullReferenceException : Object reference not set to an instance of an object.
          at Microsoft.CodeAnalysis.CSharp.ExtractMethod.CSharpMethodExtractor.CSharpCodeGenerator.GenerateMethodNameFromUserPreference()
          at Microsoft.CodeAnalysis.CSharp.ExtractMethod.CSharpMethodExtractor.CSharpCodeGenerator.GenerateMethodNameForStatementGenerators()
          at Microsoft.CodeAnalysis.CSharp.ExtractMethod.CSharpMethodExtractor.CSharpCodeGenerator.SingleStatementCodeGenerator.CreateMethodName()
          at Microsoft.CodeAnalysis.CSharp.ExtractMethod.CSharpMethodExtractor.CSharpCodeGenerator…ctor(InsertionPoint insertionPoint,SelectionResult selectionResult,AnalyzerResult analyzerResult,OptionSet options,Boolean localFunction)
          at Microsoft.CodeAnalysis.CSharp.ExtractMethod.CSharpMethodExtractor.CSharpCodeGenerator.Create(InsertionPoint insertionPoint,SelectionResult selectionResult,AnalyzerResult analyzerResult,OptionSet options,Boolean localFunction)
          at Microsoft.CodeAnalysis.CSharp.ExtractMethod.CSharpMethodExtractor.GenerateCodeAsync(InsertionPoint insertionPoint,SelectionResult selectionResult,AnalyzerResult analyzeResult,OptionSet options,CancellationToken cancellationToken)
          at async Microsoft.CodeAnalysis.ExtractMethod.MethodExtractor.ExtractMethodAsync(<Unknown Parameters>)
          at async Microsoft.CodeAnalysis.ExtractMethod.AbstractExtractMethodService`3.ExtractMethodAsync[TValidator,TExtractor,TResult](<Unknown Parameters>)
          at async Microsoft.CodeAnalysis.CodeRefactorings.ExtractMethod.ExtractMethodCodeRefactoringProvider.ExtractLocalFunction(<Unknown Parameters>)
          at async Microsoft.CodeAnalysis.CodeRefactorings.ExtractMethod.ExtractMethodCodeRefactoringProvider.GetCodeActionsAsync(<Unknown Parameters>)
          at async Microsoft.CodeAnalysis.CodeRefactorings.ExtractMethod.ExtractMethodCodeRefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>)
          at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>)
          at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

          DevExpress Support Team 5 years ago

            Hi Joseph,

            Thank you for reaching out to us.

            To process you inquiry in the most efficient manner, I've created a separate ticket on your behalf (T890796: CodeRush possibly causes System.NullReferenceException in Visual Studio Extract Method refactoring). 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.