Search code examples
visual-studio-2022

Visual Studio 2022 (v17.12.3) "Create and Assign Field" Ignores Naming Customizations


After updating Visual Studio 2022 to version 17.12.3, I noticed that the "Create and Assign Field" quick action no longer respects the naming conventions I configured in Tools > Options > Text Editor > C# > Code Style > Naming.

Previously, I had set up a naming rule for private fields to use an underscore prefix (e.g., _fieldName) as shown in the screenshot below:

Naming Customization Settings

This configuration worked globally for all solutions, and the generated code adhered to my customizations. However, after the update:

The quick action generates fields prefixed with this (e.g., this.fieldName), ignoring my rules.

Here's an example of what I'm experiencing: Create and Assign Field Behavior

What I Tried: I added an .editorconfig file (originally generated from an old project) This resolves the issue, but I have to repeat this process for every new solution, which wasn’t necessary before the update.

Is there a way to make the naming rules global again, so they apply to all solutions without needing an .editorconfig file for each one?


Solution

  • The issue is fixed in Visual Studio 2022 version 17.13.2. After updating, the 'Create and Assign Field' quick action follows the naming conventions correctly again. Thanks to @purplecat for pointing this out