Upgrade to Pro — share decks privately, control downloads, hide ads and more …

.NET Day 2023: What's new and coming soon in .NET

dotnetday
August 30, 2023

.NET Day 2023: What's new and coming soon in .NET

.NET is a powerful, comprehensive framework for building all kinds of apps: web, mobile and desktop, cloud, microservices, games, machine learning, and more. We just released .NET 7 last November, and there's a ton of great stuff in the .NET 8 previews. It's exciting, but sometimes a little overwhelming to keep up with! In this session, you'll get a look at the most important features you can use now, and a look at the top new features being added in .NET 8.

dotnetday

August 30, 2023
Tweet

More Decks by dotnetday

Other Decks in Technology

Transcript

  1. What’s new and
    coming in .NET
    Jon Galloway
    @jongalloway
    [email protected]

    View full-size slide

  2. Build anything with a unified platform
    WEB MOBILE GAMING IoT AI
    DESKTOP
    CLOUD
    .NET
    TOOLS
    Visual Studio
    Code
    CLI
    Visual Studio
    Family
    OPERATING SYSTEM
    Linux
    Windows macOS
    +
    ECOSYSTEM
    Components, tools,
    library vendors
    NuGet GitHub
    +

    View full-size slide

  3. Get Current with .NET 7
    Get ready for .NET 8

    View full-size slide

  4. .NET 6.0 LTS released Nov 2021
    Major releases every year in November
    LTS for even numbered releases
    .NET Schedule
    Nov 2021
    .NET 6.0
    LTS
    Nov 2022
    .NET 7.0
    Nov 2023
    .NET 8.0
    LTS
    Nov 2024
    .NET 9.0
    Nov 2025
    .NET 10.0
    LTS

    View full-size slide

  5. Visual Studio + Command Line
    Analyzers and code fixers
    Ability to analyze binaries
    UWP to Windows App SDK
    Xamarin to .NET 7 & .NET MAUI
    .NET Upgrade Assistant
    aka.ms/dotnet-upgrade-assistant
    178K+ >4x

    View full-size slide

  6. Every app can upgrade to the latest .NET
    WPF
    UWP upgrade to WinUI 3
    Xamarin.Forms upgrade to .NET MAUI
    WCF upgrade to .NET 7 with Core WCF
    ASP.NET upgrade to ASP.NET Core
    libraries .NET Framework & .NET -> .NET Standard2.0
    Only from .NET 7 -> upgrade to .NET 7
    WinForms,
    upgrade to .NET 7 with https://aka.ms/dotnet/upgrade

    View full-size slide

  7. Use Visual Studio to set up an ASP.NET Core
    migration project
    YARP proxies requests from the new ASP.NET Core
    app to the existing ASP.NET app as needed
    Migrate endpoints to ASP.NET Core one at time
    including any dependencies
    Continue maintaining & developing your
    ASP.NET app while upgrading
    Incrementally upgrade to ASP.NET Core
    Learn more aka.ms/aspnet/upgrade
    |

    View full-size slide

  8. Incremental
    Migration to
    ASP.NET Core
    YARP proxy
    System.Web Adapters
    https://devblogs.microsoft.com/dotnet/incremental-asp-net-to-asp-net-core-migration/

    View full-size slide

  9. Adapters for System.Web
    HttpContext HttpContext.Current HttpResponse HttpRequest
    HttpSessionState HttpCookie HttpCookieCollection … and more

    View full-size slide

  10. .NET App Modernization Resources
    https://aka.ms/dotnet-modernization-resources

    View full-size slide

  11. https://aka.ms/modernize-aspnet-videos

    View full-size slide

  12. .NET 7 Highlights
    get.dot.net/7
    Native support for ARM64
    Enhanced .NET support on Linux
    Build cross-platform mobile & desktop apps from same codebase
    Improvements to API performance
    Easy to build & deploy distributed cloud native apps
    Simplify and write less code with C#11
    HTTP/3 and minimal APIs improvements for cloud native apps
    Dev Tunnels to easily develop and debug cloud API integrations
    Configure, Build, Publish containers via .NET SDK - CLI and VS (coming soon)
    Unified
    Modern
    Simple
    Productive

    View full-size slide

  13. Performance Improvements in every release
    .NET 5 250+
    .NET 6 550+
    .NET 7 1000+
    Performance-related improvements

    View full-size slide

  14. Azure Cosmos DB Exchange Online
    30-65% CPU
    5x throughput
    85% P95 latency
    26% CPU
    80% P99 latency
    20% Heap size
    Azure App Service
     80% throughput
    Large  in CPU
    Enable gRPC & HTTP/2
    Microsoft Graph
    70B requests / day
    37% CPU
    91% Operational costs
    Azure Active Directory
    185B requests / day
    67% CPU
    50% app efficiency
    Microsoft Teams
    50 projects, 700+ APIs
    25% CPU
    60% P99 latency
    Microsoft Graph's Journey to .NET 6
    The Azure Cosmos DB Journey to .NET 6
    Azure Active Directory's gateway is on .NET 6.0!
    Exchange Online Journey to .NET Core
    Microsoft Teams' journey to .NET Core
    Microsoft Teams Assignments Service's Journey to .NET 6
    A Heavy Lift: Bringing Kestrel + YARP to Azure App Services
    .NET at Microsoft
    Teams upgrading to the

    View full-size slide

  15. Syntactic simplifications, less boilerplate
    Generic math support
    List patterns
    Required members
    Raw string literals
    General availability in .NET 7
    Simplify your code with C# 11

    View full-size slide

  16. Modern web with .NET
    Runtime
    • HTTP/3 & Faster HTTP/2
    uploads
    • ARM64 support for Kestrel &
    IIS
    • Rate Limiting
    • Output caching
    APIs
    • Auth Improvements with JWT
    • Route grouping
    • Enhanced OpenAPI support
    • gRPC JSON transcoding
    Web UI
    • Blazor custom elements
    • Data binding get/set/after
    modifiers
    • WebAssembly SIMD
    • Experimental QuickGrid

    View full-size slide

  17. Continuous focus on improvement:
    Plaintext: 8% more RPS
    JSON: 16% more RPS
    Fortunes: 25% more RPS
    .NET 7 Performance - API
    Source: https://www.techempower.com/benchmarks/#section=data-r21&hw=ph&test=json
    999.9K
    1.16M
    1 2
    +16%
    Tech Empower JSON

    View full-size slide

  18. Distributed transactions
    Mapping to JSON columns for SQL
    SaveChanges performance and bulk updates
    Custom reverse engineering templates
    Stored procedures for insert/update/delete
    .NET Data and Entity Framework Core
    New Features in .NET 7
    Source: https://devblogs.microsoft.com/dotnet/announcing-ef-core-7-preview6-performance-optimizations/
    1.7ms
    .43ms
    1 2
    4 Rows - SaveChangesAsync
    4x faster
    Time to insert multiple rows
    milliseconds (lower is better)

    View full-size slide

  19. High performance cross-platform contract-first cloud native APIs
    Requests Per Second (Higher is Better)
    Source: https://github.com/LesnyRumcajs/grpc_bench/wiki
    gRPC
    Java
    68.9K
    Go
    72.5K
    C++
    89.4K
    Rust
    96.1K
    .NET 7
    99.8K

    View full-size slide

  20. .NET REST APIs – Minimal
    Lightweight, single-file, cloud native APIs
    Low ceremony, top-level C# programs
    Easy to get started
    Scale to any app size

    View full-size slide

  21. Organize groups of endpoints
    Leverage endpoint filters for validation,
    logging, and much more
    Improved testing and OpenAPI docs
    .NET REST APIs – Powerful

    View full-size slide

  22. .NET REST APIs – Secure
    .NET 6 .NET 7

    View full-size slide

  23. .NET 7 – Rate Limiting Middleware
    public class MyController : Controller
    { [EnableRateLimitingAttribute("MyControllerPolicy")]
    public IActionResult Index()
    {
    return View();
    }
    }
    app.MapGroup("/public/todos").RequireRateLimiting("MyGroupPolicy");

    View full-size slide

  24. .NET
    Unified
    .NET
    Mobile,
    desktop,
    hybrid
    Productive
    development
    One Base Class Library
    Type Unification
    CLI Support
    SDK Style Projects
    Modern Support Lifecycle
    Android
    iOS
    WinUI
    Mac Catalyst
    Blazor WebView
    Single Project
    Microsoft.Extensions
    .NET Hot Reload
    XAML Hot Reload
    Visual Diagnostics
    .NET MAUI
    Windows
    Mac
    Catalyst
    Android
    iOS
    macOS
    iOS
    .NET MAUI
    Build all in one framework

    View full-size slide

  25. .NET MAUI Momentum
    18.8K
    1.8K
    636%

    View full-size slide

  26. Blazor in .NET 7
    Blazor Hybrid with .NET MAUI
    Custom elements
    Handle location changing events
    Bind after/get/set modifier
    Dynamic authentication requests
    Improved JavaScript interop on WebAssembly
    WebAssembly SIMD & exception handling
    …and much more!
    blazor.net
    aka.ms/blazor-in-dotnet-7

    View full-size slide

  27. ✅ Get Current with .NET 7
    👀 Get ready for .NET 8

    View full-size slide

  28. Source
    Generators
    .NET Future
    Interceptors
    AOT

    View full-size slide

  29. Before Native AOT
    Published
    Size
    88.3 MB
    Working
    Set
    235 MB
    Startup
    182 ms
    RPS
    668K
    Published
    Size
    88.7 MB
    Working
    Set
    231 MB
    Startup
    287 ms
    RPS
    707K

    View full-size slide

  30. Progress so far
    Published
    Size
    8.04 MB
    Working
    Set
    33 MB
    Startup
    27 ms
    RPS
    689K
    Published
    Size
    7.49 MB
    Working
    Set
    45 MB
    Startup
    54 ms
    RPS
    670K

    View full-size slide

  31. Route Tooling
    • Syntax Highlighting
    • Autocomplete
    • Analyzers and Fixers

    View full-size slide

  32. MVC &
    Razor Pages
    Blazor in .NET 8: The best of server & client
    Blazor
    Server-side rendering (SSR) 🚀 Client-side rendering (CSR) 🎮
    Blazor

    View full-size slide

  33. Server-side rendering
    GET
    HTML
    Blazor

    View full-size slide

  34. Streaming rendering
    GET
    HTM
    L
    Blazor
    SQL
    HTML
    Loading…

    View full-size slide

  35. Enhanced navigation & form handling
    fetch
    Blazor
    HTML

    View full-size slide

  36. Choose render mode at runtime
    Blazor WebSocket

    View full-size slide

  37. Full stack web UI with Blazor
    Server-side rendering
    Enhanced navigation & form handling
    Streaming rendering
    Add client interactivity per component or page
    Choose component render mode at runtime

    View full-size slide

  38. Generate static HTML content with components
    Use components for templating and static HTML
    rendering
    Render a component directly to a string or stream
    Render outside of the context of ASP.NET Core
    Investigating static site generation with Blazor post-
    .NET 8

    View full-size slide

  39. New Blazor Web App template
    ✓ Best of Blazor Server & Blazor WebAssembly in one template
    ✓ Quickly get setup with server-side rendering (SSR) & progressive
    enhancements
    ✓ Easily enable Server & WebAssembly interactive render modes

    View full-size slide

  40. .NET WebAssembly improvements
    SIMD & exception
    handling
    Multithreading
    Hot reload
    improvements
    Jiterpreter
    CSP compatibility
    Web-friendly
    packaging
    (Webcil)

    View full-size slide

  41. Additional Blazor enhancements in .NET 8
    QuickGrid Sections Route to
    named
    element
    Monitor
    circuit
    activity
    Improved
    authentication

    View full-size slide

  42. APIs
    Form
    handling
    Problem
    details
    API
    development
    experience
    Helpful
    analyzers

    View full-size slide

  43. Authentication and Authorization Improvements
    Client-friendly endpoints
    for identity management
    Support for tokens
    in self host scenarios
    (without OIDC server)
    Remove IdentityServer
    from templates
    (option for OIDC)

    View full-size slide

  44. Self-hosted identity
    User Manager Role Manager Sign in Manager
    Client UI
    Endpoints Razor Page UI
    Users User Claims Roles User Logins

    View full-size slide

  45. High-scale and high-availability services in .NET 8
    Resilience
    Microsoft.Extensions.Resilience
    Microsoft.Extensions.Http.Resilience
    Adds fault injection and retry pipelines
    Compliance
    Microsoft.Extensions.Compliance.Abstractions
    Microsoft.Extensions.Compliance.Redaction
    Adds data classification and redaction
    Telemetry
    Microsoft.Extensions.Telemetry
    Microsoft.Extensions.Telemetry.Abstractions
    Microsoft.Extensions.Telemetry.Console
    Microsoft.Extensions.Http.Telemetry
    Primarily add Logging enhancements and meters/metrics

    View full-size slide

  46. Visual Studio productivity
    features in
    Powered by LSP for
    C# Dev Kit for
    Visual Studio Code
    Included in
    and
    Solution & Project Management Test Explorer
    AI-assisted coding

    View full-size slide

  47. Get Current with .NET 7
    Get ready for .NET 8

    View full-size slide

  48. Follow .NET – dot.net
    aka.ms/dotnet/blog
    aka.ms/dotnet/twitter
    aka.ms/dotnet/mastodon
    aka.ms/dotnet/youtube
    aka.ms/dotnet/forums
    aka.ms/dotnet/tiktok
    aka.ms/dotnet/linkedin
    aka.ms/dotnet/facebook
    aka.ms/dotnet/github

    View full-size slide

  49. Get started with .NET 7 today!
    dot.net/learn
    Try out the latest .NET 8 preview
    get.dot.net/8

    View full-size slide

  50. Thank You!
    Let's build amazing apps with .NET 7
    get.dot.net/7

    View full-size slide