Extract to Component refactoring and the new Roslyn-based C# tokenizer are now available
This new tokenizer is not on by default until .NET 10 but is available in both Visual Studio (17.13) and Visual Studio Code for .NET 9.
To enable the C# tokenizer today, check the Use the C# tokenizer for Razor files in the IDE option under Tools > Options > Preview Features and add
<Features>use-roslyn-tokenizer;$(Features)</Features>to a property group in your.csprojordirectory.propsfile
This new lexer does currently come with some breaking changes, particularly around preprocessor directives
You must log in or # to comment.
So glad this is landing and stuff like interpolated and raw strings can be used in
.razorfiles going forward.


