News

VS Code Now Supports Blazor Development

Visual Studio Code now does Blazor development thanks to updated Razor tooling support in a C# extension.

Razor and Blazor are related as they're both part of ASP.NET Core, the Web-centric component of the .NET Core initiative that serves as a cross-platform, open source alternative to the ageing, Windows-only .NET Framework.

Razor is a syntax for combining HTML markup with C# code, according to Microsoft documentation, said to boost productivity while allowing developers to switch between markup and C# in the same file while enjoying IntelliSense support such as auto-completion.

Blazor is a Microsoft project that just graduated from the experimental stage with a way to leverage WebAssembly -- which is still experimental -- in order to do client-side and server-side Web development with C#.

Preview support for both of these is included in the C# for Visual Studio Code extension available in the Visual Studio Code Marketplace.

Last week, Microsoft announced an update to the extension that boosts Razor tooling support with improved diagnostics and tag helper support, along with giving developers auto-completion for components and component parameters, data binding, event handlers and more.

The improved Razor diagnostics, meanwhile, include pointing out errors concerning: floating @ characters; missing end braces; and missing end tags in code blocks.

The other main enhancement to Razor tooling support is auto-completion for tag helpers, along with tag helper attribute names and values.

Microsoft said the improved Razor tooling support for VS Code should be considered an alpha release, with known issues including:

  • Razor editing is currently only supported in ASP.NET Core and Blazor projects (no support for ASP.NET projects)
  • Limited support for colorization

More information about Razor tooling support in the VS Code C# extension can be found on the Razor.VSCode GitHub site. The C# extension is available in the VS Code Marketplace (more than 4 million installations), with source code available on GitHub in the C# for Visual Studio Code (powered by OmniSharp) project.

See this post for more information, including the prerequisite installations required to preview Razor support in VS Code -- along with those needed to work with Blazor -- in addition to feedback guidance and more.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Creating Business Applications Using Blazor

    Expert Blazor programmer Michael Washington' will present an upcoming developer education session on building high-performance business applications using Blazor, focusing on core concepts, integration with .NET, and best practices for development.

  • GitHub Celebrates Microsoft's 50th by 'Vibe Coding with Copilot'

    GitHub chose Microsoft's 50th anniversary to highlight a bevy of Copilot enhancements that further the practice of "vibe coding," where AI does all the drudgery according to human supervision.

  • AI Coding Assistants Encroach on Copilot's Special GitHub Relationship

    Microsoft had a great thing going when it had GitHub Copilot all to itself in Visual Studio and Visual Studio Code thanks to its ownership of GitHub, but that's eroding.

  • VS Code v1.99 Is All About Copilot Chat AI, Including Agent Mode

    Agent Mode provides an autonomous editing experience where Copilot plans and executes tasks to fulfill requests. It determines relevant files, applies code changes, suggests terminal commands, and iterates to resolve issues, all while keeping users in control to review and confirm actions.

  • Windows Community Toolkit v8.2 Adds Native AOT Support

    Microsoft shipped Windows Community Toolkit v8.2, an incremental update to the open-source collection of helper functions and other resources designed to simplify the development of Windows applications. The main new feature is support for native ahead-of-time (AOT) compilation.

Subscribe on YouTube