.NET 7 is the latest version of .NET that was released in Nov 2022. .NET 7 ecosystem offers simplifications on development, high performance, and ultimate productivity.
2. About me
• Udaiappa Ramachandran ( Udai )
• CTO-Akumina, Inc.
• Microsoft Azure MVP
• Cloud Expert
• Microsoft Azure, Amazon Web Services, and Google
• New Hampshire Cloud User Group (http://www.meetup.com/nashuaug )
• https://udai.io
8. ASP.NET Core
• RateLimitter
• CacheOutput
• Minimal API Filters
• Binding QueryString to array of primitive types
• SignalR
• Nullable types support in MVC and Razor pages
• Blazor WebAssembly
• Access to Hardware API such as filesystem, webcam, etc.,
• Location changing Event
• JavaScript Interop to invoke .NET code
• HTTP 3 (preview)
10. .NET MAUI
• MAP Control
• Desktop UI improvements
• Context menu via the MenuFlyout control
• Tooltips
• Gestures
• Window size and position with size changed event
• Simplified IDE MAUI App
11. Regular Expressions
• Fast as compiled Regex
• Faster startup
• Better debugging
• New Regex source generator
• Regex Analyzers and Fixers
https://devblogs.microsoft.com/dotnet/regular-expression-improvements-in-dotnet-7/
12. JSON Improvements
• Serialize/Deserialize Object state to JSON Text
• System.Text.Json support polymorphic type hierarchy using JsonDerivedType
attributes
• JSON contract customization (automatic in .net 6 and earlier) using resolver
• Serialize private fields and properties
• Support multiple names for a property
• Ignore properties, based on name, type or value
13. AOT (Ahead-Of-Compilation)
• AOT generates machine code at build time
• Machine code is targeting specific OS and Hardware
• Multiple Executables against Win32, Win64, Linux64, etc.,
• Everything is platform native like Go, Swift and Rust are compiled
• .NET AOT Tools
• .NET 6
• CrossGen2
• ReadyToRun
• Mano AOT for Mobile
• .NET 7
• Native AOT
• Not a replacement of existing technologies but it adds new capabilities
• <publishAot>true</publishAot>
14. AOT (Ahead-Of-Compilation)
• Pros
• Faster startup time
• Smaller file size
• Smaller memory footprint on computer
• Cons
• Console apps only
• No reflection allowed
• No dynamic loading
• No runtime code generation
15. Central Package Management
• Create Directory.Packages.props with ManagePackageVersionsCentrally to
true and include Version
• Declare PackageReference items without Version attributes in project files
https://learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management
16. Some of Other Improvements
• Brotli Compression
• Observability
• DateTime
• Tar Archives
• On-Stack Replacement (OSR)
• Profile-Guided Optimization (PGO)
• Much more……
Asp.NET Core, Razor Pages, Web API, Blazor
SignalR supports for strongly typed clients and requesting results from client invocations.
injecting services through DI
Hub constructors can accept services from the DI as parameters
Minimal API filters to implement business logic that supports code running before, after the route handler, inspecting and modifying parameters provided during the route handler invocation, and intercepting the response behavior of a route handler.
Nullable page models for Razor pages and nullable View models for MVC
Blazor components within WebView control in the desktop UI access to underlying hardware API to access local file system, webcam.
Blazor location changing events -- alert unsaved works
JavaScript interop to invoke .NET code (open .NET code from JavaScript using .NET web assembly runtime as well as call into JavaScript functionality from .NET without any dependency on the Blazor UI component model. without dependency
Announcing built-in container support for the .NET SDK - .NET Blog (microsoft.com)
# create a new project and move to its directory
dotnet new mvc -n my-awesome-container-app
cd my-awesome-container-app
# add a reference to a (temporary) package that creates the container
dotnet add package Microsoft.NET.Build.Containers
# publish your project for linux-x64
dotnet publish --os linux --arch x64 -c Release -p:PublishProfile=DefaultContainer
# run your app using the new container
docker run -it --rm -p 5010:80 my-awesome-container-app:1.0.0
Windows, macos, ios and androidshare UI layout and design across platforms
Map control delegates the native map rendering to native mobile platform (ios –apple mapss), android (google maps)
Pointer gestures, hovering mouse for secondary gestures
RegEx is pattern matching is a complex algorithm
.NET 5 Rosyln as a source generator
Not helpful if regex pattern is not known at compile time
Regex analyzers and fixers
https://devblogs.microsoft.com/dotnet/regular-expression-improvements-in-dotnet-7/
IndexOf improvements
Dotnet publish –r win-x64 –c release
code should be compiled into machine code
.net and java relied on JIT -- where code is complied twice one in developer compiletime and JIT at runtime
advantage of JIT is to run any platform, one exe can be run in multiple platform
AOT generates machine code at build time, machine code is targets specic operating system and hardware architecture such as x64,32 etc.,
AOT you must compile multiple executable Win32, Win64,Linux64
Native AOT full native pre-compilation (desktop client and services scenario)
NAOT not replacing existing technologies, new set of cababilities for unlocking several form factors
everything is platform native
simillar to how Go,Swift, and Rust are compiled
Dotnet publish –r win-x64 –c release
Pros
when startup time matters the most
smaller file sie
smaller memory footprint on computer.NET AOT Tools
Cons
console apps only
no reflection allowed
no dynamic loading
no runtime code generation (sytem.reflection.init)
OSR is complement to Tiered compilation (introduced in .net core 3.0)
<TieredPGO>true</TieredPGO>
Instrument, Train and Optimize