Microsoft ships first preview of .NET 8 and ‘Blazor United,’ releases new Visual Studio

Microsoft ships first preview of .NET 8 and ‘Blazor United,’ releases new Visual Studio

Microsoft has delivered a big batch of developer tool updates, including the first preview of .NET 8, which will be a long term support (LTS) release and is expected in November.

The .NET SDK roadmap

According to principal product manager Jeremy Likness, highlights on .NET 8 include:

  • More efficient native AOT (Ahead of time) compilation and its first implementation for macOS. The size of a simple app compiled with native AOT and targeting Linux x64 has reduced from from 3.76 MB in .NET 7 to 1.84MB in .NET 8, the post states.
  • Container images run with non-root users by default, important for security.
  • Refactored vector types and matrix calculations to take advantage of hardware acceleration.
  • Improvements to System.Text.Json, an official library which Microsoft introduced as an alternative to the popular Newtonsoft Json.Net third-party library, but which has lacked some of its features.
  • New ability to build the .NET SDK from source using a Virtual Monolithic Repository (VMR), which combines the many smaller repositories that form the SDK. “We believe that the split between the VMR and the much smaller “working repos” is the future of the .NET project,” said Likness.
  • Small container images packaged for Ubuntu Chiseled, which means they contain “only your application and its runtime dependencies, without any additional operating system-level packages or libraries,” according to an Ubuntu post. Smaller size means faster start up as well as reducing network and storage costs.

The ASP.NET Team has posted about new features in the web frameworks, including the introduction of Blazor United, a new take on the theme of NET in the browser as well as on the server. The intent is to combine Razor pages, which generate HTML on the server, with Blazor Server and Blazor WebAssembly. Blazor Server updates web components via WebSockets, while Blazor WebAssembly runs .NET in the browser itself. Developers will be able to include Blazor components in Razor pages, or add Blazor WebAssembly, giving the ability to mix and match within a single application.

Other new features in ASP.NET include enabling HTTP/3 by default, and an experimental Webcil format because, when deploying to WebAssembly, “we have received some reports from customers that certain users are unable to use their apps because firewalls and anti-virus software may prevent browsers from downloading or caching assemblies with a .DLL extension and PE contents.”

Alongside .NET 8 preview, Microsoft has shipped Visual Studio 2022 17.5 with new features including an attempt to address pain points such as slow performance or errors when editing Razor pages. There are also improvements to remote development tunnelling, container deployment to Azure, and new features for developing API applications.

A discussion on Hacker News shows enthusiasm for Blazor. “I have been using Blazor Server for a project at work…..Honestly, it is so much better than using .Net MVC/Core with js sprinkled in,” said one developer. Another remarked that “deploying and running windows servers in prod sounds like a hellish nightmare,” despite the fact that .NET has run on Linux since the release of .NET Core in 2016. Old assumptions die hard. There remains perhaps a nagging concern that .NET depends largely on one company, whereas other open source development stacks have more diverse support. Still, it has come a long way from when it was whatever Microsoft chose to ship with Windows.

.NET 8 preview is available for download though Visual Studio developers will need a preview of 17.6 to use it.