News

Blazor Update Boosts .NET/JavaScript Interoperability

Microsoft continues to churn out updates to its experimental Blazor technology for running C# code on the Web, with the latest boosting JavaScript interoperability.

Specifically, it easier handles sync and async .NET method calls from JavaScript, along with calling registered JavaScript async functions from .NET. This interoperability further belies opinions voiced by some developers that Blazor could deliver them from "the insanity of JavaScript" or foster "death to JavaScript." Microsoft has always shied away from such notions, insisting Blazor is just another tool that can be used in conjunction with JavaScript and other tech.

Even though it's just alpha-quality tech at this point, Blazor has stirred up tremendous interest in the .NET developer community, stealing the show during a recent keynote address at the Visual Studio Live! conference in Austin.

The experimental project -- developed on the ASP.NET section of GitHub -- is described as a .NET web framework using C#/Razor and HTML that runs in the browser with WebAssembly.

WebAssembly allows for compilation of high-level languages (C/C++/Rust/C# and so on) for deployment on the Web in both client and server applications.

Mozilla developer guidance describes it as: "a new type of code that can be run in modern Web browsers -- it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++ with a compilation target so that they can run on the Web. It is also designed to run alongside JavaScript, allowing both to work together."

As part of that WebAssembly/JavaScript working together feature, Blazor 0.4.0 -- just announced yesterday (June 7) -- has improved the calling of .NET methods from JavaScript code and vice-versa: calling async JavaScript functions from .NET.

Speaking of the former, the post says: "Blazor 0.4.0 makes it easy to call sync and async .NET methods from JavaScript. For example, you might call back into .NET when a JavaScript callback is triggered. While calling into .NET from JavaScript was possible with earlier Blazor releases the pattern was low-level and difficult to use. Blazor 0.4.0 provides simpler pattern with the new Blazor.invokeDotNetMethod and Blazor.invokeDotNetMethodAsync functions."

Speaking of the latter, it says: "With Blazor 0.4.0 you can now call and await registered JavaScript async functions like you would an async .NET method using the new RegisteredFunction.InvokeAsync method."

Other improvements in v0.4.0 -- coming just a month after 0.3.0 was released -- include:

  • Add event payloads for common event types
  • Use camelCase for JSON handling
  • Automatic import of core Blazor namespaces in Razor
  • Send and receive binary HTTP content using HttpClient
  • Templates run on IIS Express by default with autobuild enabled
  • Bind to numeric types

Full release notes can be found here, posted by Daniel Roth, who reminded everybody, "Please note that this is an alpha quality release and is not suitable for production applications."

Many in the developer community can hardly wait. "Is debugging support near?" asked one developer in a comment to Roth's announcement post. No answer yet.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Using Local AI to Cut Copilot Usage-Based Billing Shock

    After being gobsmacked by the new billing plan using almost all my monthly credits in one or two days, I tried pushing some Copilot-style coding work onto local models in VS Code. What I found was less "free AI" and more "pick your pain": cloud charges on one side, heavy local resource use and long waits on the other.

  • .NET 11 Preview 5 Focuses on Performance, Productivity and Safer Code

    .NET 11 Preview 5 focuses on under-the-hood runtime performance gains, streamlined APIs and language features that reduce boilerplate, plus built‑in security checks and incremental ASP.NET Core and EF Core improvements aimed at everyday developer productivity.

  • VS Code 1.124 Focuses on Agent Autonomy and Parallel Sessions

    Microsoft's June 2026 VS Code update turns on Autopilot by default and adds background sending for agent sessions.

  • Developing Agentic Systems in .NET: From Concept to Code

    ZioNet founder Alon Fliess previews his Visual Studio Live! San Diego session on building true agentic systems in .NET -- covering the cognitive loop, MCP tool integration, multi-agent orchestration and enterprise hosting and governance with the Microsoft Agent Framework.

Subscribe on YouTube