Skip to content

Visual Studio 2026 Insiders - Razor formatter inserts an unwanted space before nullable marker inside component attribute: Guid? -> Guid ? #12445

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work] [regression] [worked-in:Visual Studio 2022 -17.4.17]

It worked in Visual Studio 2022 but, in Visual Studio 2026 Insiders the Razor formatter (Ctrl+K, D or Format Document) rewrites nullable value types inside generic component attributes by inserting a space before the question mark. Example: TValue="Guid?" becomes TValue="Guid ?". This did not happen in Visual Studio 2022.

This breaks consistency, is not aligned with any C# code style rule, and in some cases causes transient red squiggles in the editor (the tokenization briefly treats Guid and ? as separate).

Environment
• Visual Studio 2026 version : Insiders [11111.16]
• Project type: Blazor
• Language version: C# 13 (nullable enabled)

Exemple:
<RadzenDropDown TValue="Guid?"></RadzenDropDown> will become when pressing CTRL+K+D
<RadzenDropDown TValue="Guid ?"></RadzenDropDown>

Thank you !


Original Comments

Feedback Bot on 30/10/2025, 02:29 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions