What's New in First Release Candidates for .NET 8, .NET MAUI, ASP.NET Core and EF8
Microsoft shipped the first release candidates for its .NET 8 offerings, including the main framework, the .NET MAUI evolution of Xamarin.Forms and the ASP.NET Core web-dev components, not to mention Entity Framework (EF8) for data devs.
At this point, with one more release candidate to go before the mid-November general availability release, most of the new features and functionality have been set, with the dev team primarily polishing things up.
Which is not to say the RCs don't introduce some new goodies, detailed in the summaries below:
".NET 8 RC1 is now available," Microsoft said. "This is our first of two release candidates. This release includes a new AOT mode for both Android and WASM, System.Text.Json improvements and Azure Managed Identity support for containers." Specific details include:
- AOT mode for Android and WASM: Devs can compile their .NET code directly into WebAssembly or native code for Android, resulting in faster startup and runtime performance, but larger app size. The team also introduced new options to strip away unused Intermediate Language (IL) code to reduce the app size.
- System.Text.Json improvements: These include new extension methods for streaming deserialization of IAsyncEnumerable, and new constructors for JsonContent that support trim safe/source generated contracts.
- Azure Managed Identity support for containers: This helps users easily authenticate with Azure Container Registry or other registries that use OAuth token exchange, without using docker login command.
- Win32 resources support for cross-building: Developers can embed Win32 resources such as icon, manifest and version information into their applications when building on non-Windows platforms.
In addition to the Sept. 12 announcement post, more information can be found in the release notes and "What's new in .NET 8" documentation.
Microsoft calls this framework the evolution of Xamarin.Forms as it adds the ability to create desktop apps in addition to traditional iOS and Android mobile targets. Though it has experienced development problems and has shipped late for .NET 6, Microsoft devs have intense interest in this offering and are following it closely after Microsoft recently announced the retirement of Visual Studio for Mac. Development problems plagued the Mac offering, too, so some .NET MAUI devs are fearful .NET MAUI may suffer the same fate. Perhaps with those problems in mind, Microsoft titled its announcement post, "Announcing .NET MAUI in .NET 8 Release Candidate 1: Quality," further saying, "The dominant theme of our .NET MAUI work in .NET 8 is code quality." With a quality boost, RC1 comes with a go-live license ready for production work. Here are some items of note in RC1, which includes new features, improvements and performance optimizations:
- Memory Leak Resolutions: Several memory leak issues were addressed in various UI controls on the iOS platform affecting the Editor, Entry, MauiDoneAccessoryView, RefreshView, SwipeView, TimePicker, Picker and GraphicsView, designed to ensure better application stability via improved memory management.
- UI Control Enhancements: UI control issues addressed affect CheckBox, RefreshView, SwipeItem, Label and Button on multiple platforms, contributing to a smoother app interaction.
- Platform-Specific Fixes: Fixes were made to ensure a consistent user experience across different platforms including iOS, Android, Windows and macOS, addressing issues like Border clipping, window glitches and image loading problems.
- Performance Optimization: The effort to improve memory usage and resource generation involved optimizations for smoother app performance and responsiveness, specifically targeting improved memory usage of CollectionView, resource generation control and Android timer issues.
Microsoft also beefed up support for Xcode 15, Apple's IDE. "You can now use Xcode 15 betas as your installation for building apps and managing simulators, and this will be available in the next releases of Visual Studio," Microsoft said. "In the next release of .NET 8 we will begin to introduce new APIs for Apple SDKs like iOS 17. We have verified this with Xcode 15 Beta 6, though newer releases may work the same."
- Blazor Web App template updates
- Discover components from additional assemblies for static server rendering
- Routing improvements
- Trigger a page refresh
- Pass through arbitrary attributes to QuickGrid
- Determine if a form field has associated validation messages
- Configure the .NET WebAssembly runtime
- Trim .NET IL after ahead-of-time (AOT) compilation
The dev team also made tweaks to:
EF Core 8
This data-driven framework comes in a NuGet package that boasts more than 809 million downloads, with the description: "Entity Framework Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates and schema migrations. EF Core works with SQL Server, Azure SQL Database, SQLite, Azure Cosmos DB, MySQL, PostgreSQL and other databases through a provider plugin API." The announcement post lists a whopping 70 items, complete with links to more information for each one.
With that many items to discuss, Microsoft's Arthur Vickers focused on providing more details on "complex types as value objects."
Basically, objects saved to the database can be categorized into three types:
- Primitive Types: These are unstructured objects that hold a single value like int, Guid, string and IPAddress.
- Entity Types: These are structured objects that hold multiple values and have a key value defining their identity. Examples include Blog, Post and Customer.
- A Third Type: These are structured objects that hold multiple values but do not have a key defining their identity. Examples include Address and Coordinate.
Before EF8, there was no efficient way to map the third type of object. Owned types could be used, but they are actually entity types and have a key and semantics based on the value of that key.
Thus EF8 introduced "complex types" to handle this third type of object. Complex types in EF Core are similar to those in EF6 but with some differences:
- They are not identified or tracked by key value.
- They must be defined as part of an entity type (you cannot have a DbSet of a complex type).
- They can be either .NET value types or reference types (EF6 only supports reference types).
- They can share the same instance across multiple properties (EF6 does not allow sharing).
See the post for more on the exhaustive discourse on complex types.
More information is also available in What's New in EF Core 8.
David Ramel is an editor and writer for Converge360.