News

'Epic Fail': ASP.NET PM Struggles with Blazor Hot Reload in Live Demo

"Epic fail," commented a developer who this week tuned in to a livestreamed ASP.NET Community Standup event on "ASP.NET Core updates in .NET 6 Preview 3" in which Daniel Roth, principal program manager (the head guy) for ASP.NET, struggled with a Blazor Hot Reload demo.

For about four minutes, watched by hundreds if not thousands of developers, the good-natured Roth laughed, tweaked, restarted and repeatedly did the puzzled fingers-to-the-chin gesture in trying to diagnose the problem.

Roth and host Jon Galloway had been ploughing through new features for ASP.NET Core coming in .NET 6, scheduled to ship in November.

In the Blazor Hot Reload segment, Roth -- using Visual Studio Code -- demonstrated how code changes could be made with the results instantly reflected in a running app with the app's state preserved, using the familiar counter example. He showed how, using dotnet watch, certain types of code changes that didn't lend themselves to Hot Reload automatically defaulted to a restart, seamlessly keeping the workflow going.

It all worked swimmingly -- until it didn't.

Jon Galloway and Daniel Roth in Livestream Demo
[Click on image for larger view.] Jon Galloway and Daniel Roth in Livestream Demo (source: Microsoft).

In a sequence that might have provided some been-there-done-that cold comfort to hackers like me who get flummoxed by mysterious glitches all the time, Roth and Galloway struggled to identify the problem, which was finally fixed with some help from the audience.

The livestream went something like this when errors popped up instead of code changes:

Roth, after seeing some kind of file locked error and finally diving into Task Manager to manually kill some .NET processes: "no you don't need to do this ... [laughter]"

"let me try it one more time"

"no it's still not updating ... huh, that's interesting"

"for some reason we're still locked ... oh well ... is it cached? ... I don't know what's going on with it, like I restarted the app ... "

Galloway: "people are saying save the file"

"oh"

[more testing]

"why not just test on a livestream? [laughter] ..."

"unresponsive ... what is going on?"

"try it one more time"

"are we good now?"

"yeah I don't know what's going on here ... that's really weird"

Galloway: "it was working super beautifully for a while ... it's in the right directory and everything"

Galloway: "people are saying the counter was a blank file"

"oh is it? Oh snap!" [much laughter]

"well that's obviously why it's not a component anymore ... ok that's fine"

So, apparently, the contents of the counter file were overwritten at some point, with nothing.

The fun begins at about the 43-minute mark in the 1 hour and 19 minute video.

Modern Web Stack
[Click on image for larger view.] Modern Web Stack (source: Microsoft).

In addition to Blazor Hot Reload, a much-requested feature that is actually being rolled out across the entire .NET 6 framework, Roth demonstrated:

  • Inner-loop performance
  • Cloud native development
  • OpenTelemetry
  • Servers
  • Performance
  • MVC
  • Single page apps (SPA)
  • Blazor WebAssembly performance and more

"Now that we're up to .NET 5, ASP.NET Core is your modern web framework for .NET," Roth said. "It's got pretty much everything you need to build UI, to build back-end services. Under the hood, we've got a powerful and flexible hosting model. We've got high-performance servers with Kestrel and IIS and HTTP.sys. And of course we've got a rich set of built-in middleware that just comes out of the box. So a lot of great stuff. But of course, there's always room to make it better."

Regarding that last point, he referenced the ASP.NET Core Roadmap for .NET 6 that tracks development efforts, part of the Themes of .NET site that shows all efforts across the ecosystem.

Themes of .NET
[Click on image for larger view.] Themes of .NET (source: Microsoft).

Roth earlier this month penned a ASP.NET Core updates in .NET 6 Preview 3 post in which new features included:

  • Smaller SignalR, Blazor Server, and MessagePack scripts
  • Enable Redis profiling sessions
  • HTTP/3 endpoint TLS configuration
  • Initial .NET Hot Reload support
  • Razor compiler no longer produces a separate Views assembly
  • Shadow-copying in IIS
  • Vcpkg port for SignalR C++ client
  • Reduced memory footprint for idle TLS connections
  • Remove slabs from the SlabMemoryPool
  • BlazorWebView controls for WPF & Windows Forms
  • The post includes the infamous Blazor counter example.

    It worked just fine in animated GIFs.

    About the Author

    David Ramel is an editor and writer at Converge 360.

    comments powered by Disqus

    Featured

    • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

      New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

    • Naive Bayes Regression Using C#

      Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

    • VS Code Copilot Previews New GPT-4o AI Code Completion Model

      The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

    • Microsoft's Rust Embrace Continues with Azure SDK Beta

      "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

    • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

      Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

    Subscribe on YouTube

    Upcoming Training Events