Microsoft's .NET 8 with Aspire cloud-ready tools for Mac is out

By Chip Loder

The .NET framework allows cross-platform development on Windows and Mac, and Microsoft released version 8 for both in November. Here's what that means to developers.

In the late 1990s, Microsoft began work on a new framework, languages, and runtime support for desktop and web development called .NET (pronounced "dot-net"). The new languages included C# (a derivative of C), F#, and the inclusion of a new version of Microsoft's Visual Basic called Visual Basic.NET or simply "VB.NET".

Microsoft announced the official release of C# at its developer conference in 2000.

Soon after, Microsoft began the development and standardization through ISO and Ecma International for what it called the Common Language Infrastructure, or CLI. The idea behind CLI is to provide a common infrastructure for all of the Microsoft-developed languages.

CLI is designed to provide consistent runtime behavior regardless of which language or technology was used to build a given piece of software.

Microsoft's Common Language Runtime, or CLR, is partly based on the CLI, as are the Microsoft compilers.

C# had a major advantage over its C and C++ predecessors in that C# source files are self-contained and no longer require the C/C++ header (.h) files included at the top of each source code file. C# provides other simplifications designed to reduce development time, and code size/complexity.

In 2002, Microsoft also announced the ASP.NET framework - a web server and cloud-based development framework that replaced Microsoft's original web server framework simply called Active Server Pages (ASP).

.NET Core

In 2014 Microsoft introduced a new version of .NET called .NET Core, and later in 2020, .NET 5. More versions followed, and on November 14th, 2023 Microsoft announced the release of .NET 8 - now the current version.

.NET Core is designed to allow cross-platform and web development on Windows, Mac, and Linux systems. .NET now consists of an installable runtime, an SDK, the .NET Core libraries, and on Windows, the Visual Studio IDE (Integrated Development Environment).

There was a Mac version of Visual Studio previously, but it has since been canceled by Microsoft as most Apple platform development is done using Apple's own IDE, Xcode.

The next version of .NET Core Version 9 is slated for a late 2024 release.

.NET MAUI

.NET MAUI, or Multi-platform App UI was introduced with .NET 6 in 2021 and can be used to build mobile apps for iOS and Android, as well as desktop apps using C#.

MAUI uses Microsoft's open XAML (Extensible Application Markup Language), which is derived from the open-source XML web standard. XAML is based on Microsoft's Open Specification Promise, essentially a declaration that Microsoft won't litigate for third-party use of MOSP technologies.

To make matters more confusing, XAML is also used in a variety of other Microsoft frameworks and technologies:

  1. WPF (Windows Presentation Foundation)
  2. WF (Windows Forms)
  3. WinUI
  4. UWP (Universal Windows Platform)

UWP was introduced with Windows 10 to provide a single unified technology for Windows 10, 10 Mobile, Xbox One and Series S/X, and HoloLens apps.

XAML elements and attributes map to CLR properties and events.

XAML can also be compiled into Microsoft's BAML (Binary Application Markup Language) files with a .BAML extension - which allows output from the above technologies to be inserted into a .NET framework assembly, and later extracted and loaded by .NET runtimes.

BAML allows faster loads and execution because it effectively inserts hints or tokens into the XAML and performs pre-runtime analysis on the code using Ahead-of-Time (AOT) compilation.

An early Academic version of Visual Studio .NET from 2003.

New features in .NET 8

.NET 8 introduces several new features, but the most significant one is Microsoft's new cloud-ready framework and tools called Aspire, which are still in preview. Aspire is billed as a "new cloud stack" designed to simplify multi-cloud development and includes features such as observability and resilience.

There is also an Aspire repository on Microsoft's main .NET GitHub page.

Aspire also uses Microsoft's client-side web app technology called Blazor which supports developing apps in C# and HTML. Blazor also now supports the popular WebAssembly and hybrid designs.

Blazor and WebAssembly speed up websites by providing single-page web apps that can be downloaded and run in the user's web browser, which reduces page and element load times due to network latency.

Aspire also uses the Redis web caching system, as well as web components for a variety of databases, the RabbitMQ messaging system, Microsoft's own Azure web technologies, Open Telemetry, and PostgreSQL.

Telemetry is a software feature tied to observability that allows the export of logs, metrics, and performance behavior automatically.

.NET 8 also now supports NuGet packages, improved JSON serialization, memory garbage collection, .NET on Linux, WPF and diagnostics improvements, and more.

All-in-all there are eighteen new features listed on Microsft's What's New in .NET page.

One interesting aspect of Aspire is that Microsoft claims Aspire support can be added to existing .NET solutions (projects) assuming solutions are first upgraded fully to .NET 8.

Aspire general availability is slated for sometime in the spring of 2024.

Microsoft also released Visual Studio 17.8 for Windows to coincide with the .NET 8 release. A new local-only AI tool for Visual Studio called Windows AI Studio based on Azure AI Studio is set to be released in the next few weeks.

Getting and installing .NET

On the Mac, you can download and install .NET by downloading the components from Microsoft's website, .NET pages, or download a container image and use it to install the complete environment.

There is also an ASP.NET Core download page.

Microsoft also has a complete .NET GitHub page which has hundreds of git repositories for the .NET runtimes, .NET Core, asp.net Core, .NET SDKs, the .NET compilers for C# and Visual Basic (codenamed "Roslyn"), the F# compiler, Windows Forms for building desktop apps, and documentation.

The msbuild repo contains the Microsoft Build Engine which is used by the compilers, Visual Studio, and the Command-Line Interface for building projects.

You can alternately use the Homebrew package manager on macOS to install .NET using Homebrew .NET formulae:

brew install dotnet

Note that brew install dotnet is a new formula for .NET 8 and it conflicts with the two older .NET Homebrew formulae:

  1. brew install --cask dotnet (Runtime)
  2. brew install --cask dotnet-sdk (SDK)

According to the Homebrew formulae documentation pages, the two older cask formulae don't support Apple Silicon Macs, but the new .NET 8 formula does.

For Windows .NET 8 installs there is also a separate .NET Desktop Runtime you'll need to download to your Windows computer and install.

There are separate download pages for all supported platforms.

Overall .NET 8 looks promising, and if Microsoft follows through with the Aspire project, it promises to make multicloud development simpler.

Also check out the dotnetconf.net virtual event online for some .NET tutorials. The site also has a YouTube channel with several introductory .NET videos.