What Changed
We enabled Code Diagnostics by default using the Project Converter tool.
Reasons for Change
This change helps to detect XAF-specific errors in your code as you type and thus improves the user experience when developing XAF apps.
Impact on Existing Apps
This change affects all XAF .NET 6-based WinForms and Blazor projects (excluding .NET Framework projects) for versions older than v22.2.2.
If a code analyzer finds XAF/XPO best practice violations, they are reported in the code editor (as a squiggle under the invalid code) and in the Error List window of Visual Studio.
How to Revert to Previous Behavior
This topic describes how to remove the previous behavior: Disable Code Analysis. If your XAF solution has multiple projects, you can disable Roslyn error diagnostics globally for the whole solution using one of the following options:
- Directory.Build.props
- .editorconfig
- Tools > Options > Text Editor > C# > Advanced > Run background code analysis for = None
- Control+Shift+H to invoke the Find and Replace dialog) > Replace in Files (to replace
<PackageReference Include="DevExpress.ExpressApp.CodeAnalysis" Version="22.2.2" />
with an empty string using Replace All).
If you remove the DevExpress.ExpressApp.CodeAnalysis package from your projects in v22.2.2 or newer (because you do not need these error diagnostics), the Project Converter will not add them again when you upgrade to v22.2.3 or newer. We did this intentionally to avoid adding the package again and again once you opt out.