Skip to content

miroslavpopovic/what-is-new-in-dotnet

Repository files navigation

What's new in .NET world?

A sample code for a talk "What's new in .NET world". This sample is written for .NET 7 and .NET 8, using C# 11 and C# 12.

The sample code and a separate presentation for ASP.NET Core Minimal APIs is available in a separate GitHub repository.

The older sample covering .NET 6 and .NET 7 is available in another repository.

Presentations

Languages

C#

A new proposals for C# features are available in the C# language GitHub repository.

Version 11 (.NET 7)

Version 12 (.NET 8)

F#

Version 7 (.NET 7)

  • Announcement
  • Static abstract members in interfaces
  • Easier Statically Resolved Type Parameters
  • Required properties checking, init scope and init-only parameters
  • Reference assemblies support
  • F# self-contained deployment
  • Native AOT

Version 8 (.NET 8)

  • Announcements
  • F# inline types and parameter name hints in Visual Studio
  • New syntax for string interpolation
  • New while! keyword
  • Graph-based type-checking - a new compiler feature
  • _.Property shorthand for (fun x -> x.Property)
  • Nested record field copy and update
  • Use and compose string literals for printf and related functions
  • Arithmetic operations in literals
  • Type constraint intersection syntax
  • Extended fixed bindings
  • Easier [<Extension>] method definition
  • Making F# more uniform
    • Static members in interfaces
    • Static let in discriminated unions, records, structs, and types without primary constructor
    • try-with within seq{}, [] and [||] collection expressions
    • Announcement
  • New diagnostics
    • TailCall attribute
    • Diagnostics on static classes
    • Diagnostics on [<Obsolete>] usage
    • Optional warning when obj is inferred
    • Optional warning when copy and update changes all fields
    • Announcement
  • Quality of life improvements
    • Trimmability for compiler-generated code
    • Parser recovery
    • Strict indentation rules
    • Autocomplete improvements
    • [<Struct>] unions can now have > 49 cases
  • Compiler performance
    • Reference assemblies optimization
    • New switches for compiler parallelization
    • Announcement
  • Enhancements to the FSharp.Core standard library

Visual Basic

  • No new features in the language itself!
    • Other than the ones that are shared with all .NET languages
  • Some improvements, like refactorings, are available in Visual Studio 2022
  • WinForms Visual Basic Application Framework has new features

.NET BCL, SDK and tools

BCL library APIs

.NET 7

.NET 8

System.Text.Json

.NET 7

.NET 8

  • Blog posts and announcements
  • Improvements
    • Missing member handling - JsonUnmappedMemberHandling - Sample
    • Source generator support for required and init properties
    • JsonSourceGenerationOptionsAttribute now has feature parity with the JsonSerializerOptions class
    • Interface hierarchy support
    • snake_case and kebab-case support for property names - Sample
    • JsonSerializer.IsReflectionEnabledByDefault property to help with Native AOT scenarios
      • Not all serialization options are supported - i.e., dynamic types are not
    • JSON contract customization improvements
      • New IJsonTypeInfoResolver.WithAddedModifier extension method
    • Improvements for combining source generators - JsonSerializerOptions.TypeInfoResolverChain
    • Unspeakable types support - i.e., local functions
    • Support for Memory<T> and ReadOnlyMemory<T> types
    • Support for Half, Int128 and UInt128 types
    • Extending JsonIncludeAttribute and JsonConstructorAttribute to non-public members
    • An option to disable reflection defaults
    • System.Net.Http.Json extensions for IAsyncEnumerable
    • JsonNode.ParseAsync APIs
    • JsonSerializerOptions.MakeReadOnly(bool populateMissingResolver) for setting options as readonly
    • Announcement 1
    • Announcement 2
    • Announcement 3
    • Announcement 4
    • Announcement 5
    • Announcement 6
  • Populating read-only members
  • New converter - JsonStringEnumConverter<TEnum>
  • Single-usage JsonSerializerOptions analyzer
  • Additional JsonNode functionality
    • I.e., Deep Cloning, parsing from a stream,...
    • Announcement

.NET SDK

.NET 7

  • Native AOT
    • No longer experimental
    • Generates code at build time instead of runtime
    • Improves startup time, memory usage, access to restricted platforms (no JIT), size on disk
    • Console apps and native libraries only
    • Announcement
    • Specification
  • New CLI parser
    • dotnet new improved CLI
    • dotnet --info updates
    • Announcement
  • Central Package Management – Directory.Packages.props
  • Improved .NET host error messages – i.e., missing runtime errors
  • Console.ReadKey improved, especially for Linux
  • Template authoring improvements
    • Constraints (OS, workload, host), multi-choice parameters, better exit codes and error reporting
    • Announcement
  • Built-in container support for .NET SDK

.NET 8

Tools

.NET 7

  • Hot Reload improvements for Blazor WebAssembly, iOS and Android
    • More lambda methods support
    • Adding new static fields, static methods, and non-virtual instance methods
    • Adding new classes
    • dotnet watch restarts for rude edits
    • Announcement
  • NuGet 6.4

.NET 8

Performance improvements

.NET 7

.NET 8

Entity Framework Core

.NET 7

.NET 8

ASP.NET Core

.NET 7

Minimal APIs

  • Blog posts
  • Sample
  • IEndpointFilter support
  • IFormFile and IFormFileCollection
  • Binding to Stream or PipeReader
  • Binding a set of parameters into a single object with properties with [AsParameters]
  • Binding arrays
  • Endpoint description and summaries used for OpenAPI
  • IResult implementations are now public for improved testability and have new interfaces
    • IContentTypeHttpResult, IFileHttpResult, INestedHttpResult, IStatusCodeHttpResult, IValueHttpResult
    • Announcement
  • Typed results – Microsoft.AspNetCore.Http.TypedResults
  • Self-describing minimal APIs
    • IEndpointMetadataProvider, IEndpointParameterMetadataProvider
    • Uses C# 11 static abstract interface members, works with TypedResults
    • Announcement
  • Route groups with MapGroup()

SignalR

.NET 8

Minimal APIs

SignalR

Blazor

.NET 7

Blazor Hybrid

.NET 8

MAUI

.NET 7

.NET 8

gRPC

.NET 7

.NET 8

  • gRPC JSON transcoding no longer requires http.proto and annotations.proto
  • Native AOT supported for both client and server apps

.NET Aspire

Desktop

Windows Forms

.NET 7

.NET 8

  • TODO: ...

WPF

.NET 7

.NET 8

Monitoring and metrics

.NET 7

  • Added metrics for Microsoft.Extensions.Caching
    • MemoryCacheStatistics – cache hit/miss/estimated size and count
    • IMemoryCache.GetCurrentStatistics()
    • Announcement

.NET 8

  • Metrics added for ASP.NET Core hosting, Kestrel and SignalR
  • A new Azure Monitor OpenTelemetry distro library
    • Enables monitoring ASP.NET Core apps with Azure Monitor, based on the infrastructure of OpenTelemetry for .NET
    • Announcement
  • Testing metrics in ASP.NET Core apps using IMeterFactory and MetricCollector<T>
  • New, improved and renamed counters

CoreWCF

  • Community project
  • Features are a subset of functionality from WCF
    • HTTP and NetTCP transports
    • BasicHttpBinding, NetHttpBinding, NetTcpBinding, WebHttpBinding, WSHttpBinding (some WS-* features are not supported)
    • Transport security, Username, Certificate and Windows auth, WS Federation...
    • WSDL generation
    • Partial configuration support including service and endpoints
    • Extensibility (IServiceBehavior and IEndpointBehavior)
  • Not implemented
    • Transports other than HTTP and NetTCP
      • Named Pipes are coming in 1.4
    • Message security beyond Transport and Transport with Message Credentials
    • Distributed transactions
    • Message Queueing
      • Queue Transport is coming in 1.4
  • 1.0 released in April 2022.
  • Project templates added in 1.1
  • 1.2 released in September 2022.
  • 1.3 brought support for ASP.NET Core authorization
  • 1.4 brings support for Named Pipes and Queue transports
  • .NET Upgrade Assistant is able to migrate WCF services to CoreWCF
  • Client support for calling WCF/CoreWCF with System.ServiceModel 6.0 is available

YARP

ML.NET

SynapseML for .NET

Microsoft Orleans

  • Cloud native application framework for .NET
  • Version 7.0 released with with .NET 7
    • Announcement
    • Inlined with .NET versions
    • Performance improvements
    • Improved development experience
    • Simplified Grain and Stream identification

Dapr

Community Toolkits

Other libraries

Cloud and dogfooding

Visual Studio

Visual Studio Code

JetBrains tools

Dev tools

GitHub Copilot

AI

License

See LICENSE file.

About

A sample code for a talk "What's new in .NET world". This sample is written for .NET 7 and .NET 8, using C# 11 and C# 12.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published