ABP Now Supports .NET 8
Recently we have published ABP v8.0. With this version the ABP Framework and ABP Commercial both supports for .NET 8, aligning itself with the latest enhancements and new features of the ASP.NET's new version 8.
Here's the related PR for this upgrade. This update ensures that developers using ABP can leverage the new features and improvements of .NET 8, enhancing the capability and performance of their applications. With .NET 8 support, ABP 8.0 likely offers improved performance, enhanced security, and greater efficiency, making it a robust choice for building modern web applications.
Here's the summary of .NET 8 features and enhancements:
What's new in .NET 8
.NET Aspire is a tool to observe and manage distributed web applications. It's still preview version. You can manage your containers, executables, logs, traces and metrics of your running web application. For more information see this article https://devblogs.microsoft.com/dotnet/introducing-dotnet-aspire-simplifying-cloud-native-development-with-dotnet-8/
12 features have been implemented for System.Text.Json serialization and deserialization library with .NET 8. See these enhancements
- Built-in support for additional types
- Source generator
- Interface hierarchies
- Naming policies
- Read-only properties
- Disable reflection-based default
- New JsonNode API methods
- Non-public members
- Streaming deserialization APIs
- WithAddedModifier extension method
- New JsonContent.Create overloads
- Freeze a JsonSerializerOptions instance
The new IUtf8SpanFormattable interface targets
Span<byte> instead of
Span<char>. Also the new Utf8.TryWrite methods provide a
UTF8 based counterpart to the existing MemoryExtensions.TryWrite methods, which are UTF16-based.
|New Data Attribute
|Checks whether bounds are included in the allowable range
|Checks both lower and upper bounds for strings or collections. For example,
[Length(5, 10)] requires at least 5 elements and at most 10 elements in a collection
|Checks that a string is a valid Base64 format
|Checks if values are from the allowed or disallowed list eg:
[AllowedValues("man", "woman", "child")]
The System.Random and System.Security.Cryptography.RandomNumberGenerator types present 2 new approaches to handling randomness.
- The new System.Collections.Frozen namespace includes the collection types FrozenDictionary and FrozenSet.
- Methods like MemoryExtensions.IndexOfAny look for the first occurrence of any value in the passed collection.
- The new System.Text.CompositeFormat type is useful for optimizing format strings that aren't known at compile time (for example, if the format string is loaded from a resource file).
- New System.IO.Hashing.XxHash3 and System.IO.Hashing.XxHash128 types provide implementations of the fast XXH3 and XXH128 hash algorithms.
System.Numerics and System.Runtime.Intrinsics
SHA-3 (Secure Hash Algorithm 3) is the latest member of the Secure Hash Algorithm family of standards. With .NET 8 SHA-3 is being supported.
HTTPS proxy support
Stream-based ZipFile methods
The new ZipFile.ExtractToDirectory provides a stream containing a zipped file and extract its contents into the filesystem.
Hosted lifecycle services
Hosted services now have more options for execution during the application lifecycle. IHostedService provided
StopAsync, and now IHostedLifecycleService provides these additional methods:
Native AOT support
The option to publish as Native AOT was first introduced in .NET 7. Publishing an app with Native AOT creates a fully self-contained version of your app that doesn't need a runtime—everything is included in a single file. .NET 8 brings the following improvements to Native AOT publishing:
|Linux x64 (with
Target iOS-like platforms with Native AOT
.NET 8 starts the work to enable Native AOT support for iOS-like platforms. You can now build and run .NET iOS and .NET MAUI applications with Native AOT on the following platforms:
.NET 8 includes improvements to code generation and just-in time (JIT) compilation:
- Arm64 performance improvements
- SIMD improvements
- Support for AVX-512 ISA extensions (see Vector512 and AVX-512)
- Cloud-native improvements
- JIT throughput improvements
- Loop and general optimizations
- Optimized access for fields marked with ThreadStaticAttribute
- Consecutive register allocation. Arm64 has two instructions for table vector lookup, which require that all entities in their tuple operands are present in consecutive registers.
- JIT/NativeAOT can now unroll and auto-vectorize some memory operations with SIMD, such as comparison, copying, and zeroing, if it can determine their sizes at compile time.
This section contains the following subtopics:
- CLI-based project evaluation
- Terminal build output
- Simplified output paths
- 'dotnet workload clean' command
- 'dotnet publish' and 'dotnet pack' assets
- Template engine
- Source Link
- Source-build SDK
ASP.NET composite images
As part of an effort to improve containerization performance, new ASP.NET Docker images are available that have a composite version of the runtime. This composite is built by compiling multiple MSIL assemblies into a single ready-to-run (R2R) output binary. Because these assemblies are embedded into a single image, jitting takes less time, and the startup performance of apps improves. The other big advantage of the composite over the regular ASP.NET image is that the composite images have a smaller size on disk.
Source-generated COM interop
.NET 8 includes a new source generator that supports interoperating with COM interfaces.
Minimum support baselines for Linux
The minimum support baselines for Linux have been updated for .NET 8. .NET is built targeting Ubuntu 16.04, for all architectures.
AOT compilation for Android apps
To decrease app size, .NET and .NET MAUI apps that target Android use profiled ahead-of-time (AOT) compilation mode when they're built in Release mode. Profiled AOT compilation affects fewer methods than regular AOT compilation. .NET 8 introduces the
<AndroidStripILAfterAOT> property that lets you opt-in to further AOT compilation for Android apps to decrease app size even more.
.NET 8 includes several new code analyzers and fixers to help verify that you're using .NET library APIs correctly and efficiently. The following table summarizes the new analyzers.
Starting in .NET 8, NuGet verifies signed packages on Linux by default. NuGet continues to verify signed packages on Windows as well.
C# Hot Reload supports modifying generics
Starting in .NET 8, C# Hot Reload supports modifying generic types and generic methods. When you debug console, desktop, mobile, or WebAssembly applications with Visual Studio, you can apply changes to generic classes and generic methods in C# code or Razor pages. For more information, see the full list of edits supported by Roslyn
More from Alper Ebiçoğlu
Blazor's History and Full-stack Web UI
The first version of Blazor was released on May 14, 2020. Since its initial release, Blazor has evolved into six different versions. In this post, I e...
What’s New in .NET 8 🧐 ? Discover ALL .NET 8 Features⚡🚀
📢 In this post, we'll explore all the new features of .NET 8 and the changes in this new version. Grab your coffee ☕ and let's take a look at all the...