Visual Studio Code Gears Up for Blazor

Microsoft is preparing its open source Visual Studio Code editor to support Blazor, the company's experimental technology for using languages such as C# for Web programming, which is currently dominated by JavaScript.

The promise of such a capability is creating a lot of buzz because Web coding using languages other than JavaScript would open up huge opportunities for .NET-centric and other developers.

Microsoft's efforts to gear up VS Code for Blazor start with initial support for Razor, its ASP.NET programming syntax for creating dynamic Web pages with C# or VB.NET. That markup syntax for embedding server-based code into Web pages consists of Razor markup, C# and HTML.

The company recently announced that Razor support in VS Code was available in preview, baked in to the C# for Visual Studio Code extension available in the Visual Studio Code Marketplace.

The initial support introduces functionality currently limited to offering code-completion options for HTML, C# and Razor directives in ASP.NET Core projects, along with the "red squiggles" that provide diagnostic information such as a possible problem.

Microsoft's Daniel Roth emphasized that this first alpha release for Razor tooling in VS Code comes with a number of limitations and known issues, including the lack of support for ASP.NET projects or Blazor projects.

"Even though the functionality of Razor tooling is currently pretty limited, we are shipping this preview now so that we can start collecting feedback," Roth said. Fleshing out the Razor support is a prerequisite for eventually adding Blazor support in VS Code, Roth indicated.

Ironically, the VS Code preview support for Razor -- and eventually Blazor -- was introduced shortly after client-side Blazor problems were reported by Microsoft, perhaps tempering that aforementioned Blazor buzz somewhat. Specifically, Microsoft revealed that its Blazor effort is being hampered by problems in working with WebAssembly, itself a young, experimental technology that provides the foundation of the Blazor effort with its goal of providing an assembly-like language that acts as a compilation target to enable C, C++, C# and other code to run in the browser.

Those problems prompted Microsoft to delay the client-side Blazor effort that depends so heavily upon WebAssembly, though the server side is progressing faster (under the moniker "Razor Components"), to the point where server-size Blazor is planned to be included in next year's release of .NET Core 3.0.

Meanwhile, work on Razor/Blazor support in VS Code will continue. "Next up we are working on tag helper support," Roth said of the Razor preview effort. "This will include support for tag helper completions and IntelliSense. Once we have tag helper tooling support in place we can then start work on enabling Blazor tooling support as well. Follow our progress and join in the conversation on the repo."

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus


  • 'Dev Home' Update Leads Developer Goodies in AI-Powered Windows 11 Update

    Along with today's new AI-powered Windows 11 update come new goodies for developers, including a new edition of Dev Home, a preview offering described as a "control center" providing coding-focused features and functionality.

  • Community Dev Gives VS Code Python Some YAPF

    The latest update to Python in Visual Studio Code includes a new extension for Python formatting that was contributed by a member of the open source community.

  • Devs Demand Visual Studio 2022 Ditch Old .NET Framework Dependencies

    Developers commenting on a Microsoft post about performance improvements in the upcoming .NET 8 demanded the company end Visual Studio 2022's dependency on the old .NET Framework.

  • Microsoft Remakes Azure Quantum Dev Kit with Rust, 'and It Runs in the Browser!'

    "The' tl;dr' is that we rewrote it (mostly) in Rust which compiles to WebAssembly for VS Code or the web, and to native binaries for Python."

Subscribe on YouTube