Bug Report T1116618
Visible to All Users

DeclareProvider encounters an error and is disabled after upgrading to vs2022 17.4 preview 2.0

created 2 years ago (modified 2 years ago)

I upgraded to vs2022 17.2 preview 2.0 yesterday and saw this error appear after starting vs2022 and loading our main solution:

Call Stack
System.NullReferenceException : Object reference not set to an instance of an object. at DevExpress.CodeAnalysis.CSharp.IdentifierNameSyntaxExt.IsEventHandler(SimpleNameSyntax identifier,Document document,SemanticModel semanticModel,CancellationToken cancellationToken,ITypeSymbol& delegateSymbol) at DevExpress.CodeAnalysis.CSharp.CodeDeclare.MethodAvailabilityHelper.IsAvailableIdentifier(RefactoringContext context,SimpleNameSyntax targetIdentifier) at DevExpress.CodeAnalysis.CSharp.CodeDeclare.MethodAvailabilityHelper.HasAvailableIdentifier(RefactoringContext context,SimpleNameSyntax& targetIdentifier) at DevExpress.CodeAnalysis.CSharp.CodeDeclare.MemberAvailabilityHelper.GetAvailableNodeSync(RefactoringContext context) at DevExpress.CodeAnalysis.CSharp.CodeDeclare.MemberAvailabilityHelper.GetAvailableNode(RefactoringContext context) at async DevExpress.CodeAnalysis.CSharp.CodeDeclare.DeclareMemberRefactoring.RefactoringIsAvailable(<Unknown Parameters>) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at async DevExpress.CodeAnalysis.Refactorings.RefactoringProvider.GetAvailableRefactorings(<Unknown Parameters>) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at async DevExpress.CodeAnalysis.Refactorings.RefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>)

Visual Studio info:

Microsoft Visual Studio Professional 2022
Version 17.4.0 Preview 2.0
VisualStudio.17.Preview/17.4.0-pre.2.0+32912.340
Microsoft .NET Framework
Version 4.8.04161

Installed Version: Professional

ASP.NET and Web Tools 17.4.210.756
ASP.NET and Web Tools

Azure App Service Tools v3.0.0 17.4.210.756
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 17.4.210.756
Azure Functions and Web Jobs Tools

C# Tools 4.4.0-2.22430.14+2f760738cb92f32f50c981b68ba04ac3c8b7ee48
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

CodeRush for Roslyn 22.1.4.0
DevExpress CodeRush for Roslyn package.

CodeRush for Roslyn Tool Windows 22.1.4.0
DevExpress CodeRush for Roslyn Tool Windows package.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

NuGet Package Manager 6.4.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Razor (ASP.NET Core) 17.0.0.2243101+64a0117763b8eb085c75bdb80329e16e5a2c65a5
Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools 17.0.62207.28050
Microsoft SQL Server Data Tools

TypeScript Tools 17.0.10901.2002
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.4.0-2.22430.14+2f760738cb92f32f50c981b68ba04ac3c8b7ee48
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 17.4.0-beta.22429.6+22514929f2e903ea8c14947bea7c2b242886e1ee
Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.

WiX Toolset Visual Studio Extension 1.0.0.20
WiX Toolset Visual Studio Extension version 1.0.0.20
Copyright © .NET Foundation and contributors. All rights reserved.

Answers approved by DevExpress Support

created 2 years ago

We have addressed the issue described in this ticket and will include a fix in our next maintenance update. Should you need to apply our fix prior to official release, you can request a hotfix here.

Important Notes:

  • Hotfixes may be unavailable for Early Access/Beta builds or updates set for release within a week.
  • .NET only: in the NuGet Package Manager, use your personal NuGet feed and check the "Include prerelease" option to view the hotfix package in the "Updates" tab.

    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.