Marco Parenzan
marco [dot] parenzan [at] 1nn0va [dot] it
www.marcoparenzan.com
Marco Parenzan
Solution Sales Specialist in Insight for Digital Innovation
Azure MVP
Community Lead 1nn0va // Pordenone
Linkedin: https://www.linkedin.com/in/marcoparenzan/
.NET 5
INFRASTRUCTURE
.NET STANDARD
DESKTOP WEB CLOUD MOBILE GAMING IoT AI
WPF
Windows Forms
UWP
ASP.NET Xamarin UnityAzure ARM32
ARM64
ML.NET
.NET for
Apache Spark
.NET – A unified platform (2019)
4
Now in November 2020
What is not in .NET 5?
• AppDomains, remoting, Web forms, WCF server and Windows workflow
remain on .NET Framework 4.8 only
• No plans to port…
Add a footer 5
Add a footer 6
Target Framework Moniker
Add a footer 7
Simplified network names with .NET 5
Add a footer 8
What should you target?
Add a footer 9
The .NET SDK releases quarterly
.NET Schedule (2019)
• .NET Core 3.0 released today!
• .NET Core 3.1 = Long Term Support (LTS)
• .NET 5.0 release in November 2020
• Major releases every year, LTS for even numbered releases
• Predictable schedule, minor releases if needed
July 2019
.NET Core 3.0
RC
Sept 2019
.NET Core 3.0
Nov 2019
.NET Core 3.1
LTS
Nov 2020
.NET 5.0
Nov 2021
.NET 6.0
LTS
Nov 2022
.NET 7.0
Nov 2023
.NET 8.0
LTS
Visual Studio 2019 16.8 GA and 16.9
Preview
• .NET 5.0 included
• .NET productivity enhancements
• Intellicode team completions
• New Git experience
• Linux debugging
• Improved XAML experience
• GitHub Actions in Visual Studio
visualstudio.com/download
aka.ms/vs-preview
.NET 5 General Availability
• Continued performance improvements
• Windows ARM64 support
• smaller container images
• Single file applications (10 years after I played with reflection)
• Web and cloud investments
• Windows desktop development enhancements
• New C# 9.0, F# 5.0 language features
Three areas of
interest
…among other s …
Add a footer 13
Full stack .NET web apps with Blazor in .NET 5
• Supports Blazor Server & Blazor WebAssembly
• Blazor WebAssembly enhancements
• Now uses .NET 5 core framework libraries
• 3X faster than previous release
• Supports server-side prerendering & lazy loading dependencies
• Component virtualization
• CSS & JavaScript isolation
• New components
• Growing ecosystem of third-party
& OSS controls and tools
Windows desktop apps on .NET 5
• Complete development experience
• Windows Forms & WPF designers
• Visual Studio tooling
• Clickonce Installer support
• Third-party tools & controls
• All the benefits of .NET 5
• Self contained, single file EXEs
• No need for .NET Framework on machine
• Best performance
• Modern controls like WebView2
.NET MAUI
One file deployment
Demo
Add a footer 18
The third one
Add a footer 19
.NET adoption
200K
Windows developers migrated to .NET Core
230K
First time .NET developers in September 2020
2 million
Publishes per month to Linux from Visual
Studio
WinForms & WPF
on .NET Core
.NET Core
.NET on Linux
5 million
.NET developers
Monthly active developers in Visual Studio Family
.NET 5 performance improvements
TechEmpower benchmarks perf increases for .NET 5 over .NET Core 3.1
+38%
Plaintext
+42%
Json
https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-5/
.NET 5 performance improvements
• +30% socket performance improvement on Linux over .NET Core 3.1
• JSON serialization performance improved +19% over .NET Core 3.11
• Serialization of large collections & arrays improved 3x and are now zero-alloc
• gRPC server performance exceeds Go, C++ and Java2
1 All 104 JSON serialization benchmarks improved
2 https://github.com/LesnyRumcajs/grpc_bench/wiki/2020-08-11-bench-results
0
10000
20000
30000
40000
50000
60000
rust_tonic_mt dotnet_grpc go_grpc cpp_grpc_mt java_grpc
gRPC Server Performance Requests/Sec
(higher is better)
Demo
Add a footer 23
And now…
competing with Open Source…
from the dev POV
Add a footer 24
What’s new in C#9
Add a footer 25
C# language evolution
• C# 1.0 was a new managed language
• C# 2.0 introduced generics
• C# 3.0 enabled LINQ
• C# 4.0 was all about interoperability with dynamic non-strongly typed languages.
• C# 5.0 simplified asynchronous programming with the async and await keywords.
• C# 6.0 the language has been increasingly shaped by conversation with the community, now to the
point of taking language features as contributions from outside Microsoft
• C# 7.x will be no exception, with tuples and pattern matching as the biggest features, transforming and
streamlining the flow of data and control in code. Point releases
• C# 7.1, 7.2, 7.3 Safe Efficient Code, More Freedom, Less Code
• C# 8 running in the function path
C# 7 objectives
• Working with data
• Pattern Matching
• Tuples
• Deconstruction
• Discards
• Code Simplification
• Expression Bodied Properties, Constructor Finalizer
• Throw expression
• Out Variables
• Binary Literals and Digit separator
• Improved Performances
• Local Functions
• Return values and local variables by reference
“Functional”
What’s new in C# 8
• Default interface methods
• Pattern matching enhancements:
• Switch expressions
• Property patterns
• Tuple patterns
• Positional patterns
• Using declarations
• Static local functions
• Indices and ranges
• Null-coalescing assignment
• stackalloc in nested expressions
“Pythonic” 
.NET for Apache Spark
• .NET bindings (C# e F#) to Spark
• Written on the Spark interop layer,
designed to provide high performance
bindings to multiple languages
• Re-use knowledge, skills, code you
have as a .NET developer
• Compliant with .NET Standard
• You can use .NET for Apache Spark
anywhere you write .NET code
• Original project Moebius
• https://github.com/microsoft/Mobius
Pythonizing C# (since
C# 7.x)
Add a footer 30
Guido Van Rossum joins Microsoft
Add a footer 32
Top level statement
• Only one file in a project the code you could write in a Main method directly
without method and class
• Else is a syntax error
• You have no reference to that class (that is compiler generated)
• …and it is async by default! 
Add a footer 33
Init-only setter
• Use of object initializer as a constructor
• But you need R/W propertiesMutability
• In a world that is going to “immutability”
Add a footer 34
Record types
• We had already immutabilityanonymous types
• Anonymous types brought another featurestructural equivalence
(implementing IEquatable<T> interface)
• RECORDS!
Add a footer 35
Positional Records
• The never implemented feature of principal constructor
• In this case, only syntactic sugar
• Only for record, not class
• Most concise implementation for immutable record
• Brings a Deconstruct implementation (that is positional!)
• If you define explicily fields, it can be mutable
Add a footer 36
Improved pattern matching
• Recap 7:
• Adding value in switch statement
• case 0: is the familiar constant pattern.
• default: is the familiar default case.
• New conditions
• case IEnumerable<int> childSequence: is a type pattern.
• case int n when n > 0: is a type pattern with an additional when condition.
• case null: is the null pattern.
Add a footer 37
Improved pattern matching
• Recap 8:
• Switch expression
• Arrow syntax (case and ‘:’ replaced by ‘=>’)
• ‘default:’ replaced by the discard ‘_’
• Bodies are expressions non statement
• Property pattern
• location switch
• {
• { State: "WA" } => salePrice * 0.06M,
• Tuple pattern
• You apply switch statement to a tuple
• (first, second) switch
• {
• ("rock", "paper") => "rock is covered by paper. Paper wins.",
• Positional pattern
• You apply tuple a switch expression condition to an object that support decostruction
• point switch
• {
• (0, 0) => Quadrant.Origin,
• var (x, y) when x > 0 && y > 0 => Quadrant.One,
Add a footer 38
Improved pattern matching
• Now with C#9
• Type pattern (look! You don’t repeate variable!)
• c is >= 'a' and <= 'z' or >= 'A' and <= ‘Z’;
• Use parentesys
• c is (>= 'a' and <= 'z') or (>= 'A' and <= 'Z') or '.' or ‘,’
• Null check!
• e is not null
Conclusion
Add a footer 39
Add a footer 40
Conclusion
• https://www.youtube.com/c/dotNET/videos

Mini .net conf 2020

  • 1.
    Marco Parenzan marco [dot]parenzan [at] 1nn0va [dot] it www.marcoparenzan.com
  • 2.
    Marco Parenzan Solution SalesSpecialist in Insight for Digital Innovation Azure MVP Community Lead 1nn0va // Pordenone Linkedin: https://www.linkedin.com/in/marcoparenzan/
  • 3.
    .NET 5 INFRASTRUCTURE .NET STANDARD DESKTOPWEB CLOUD MOBILE GAMING IoT AI WPF Windows Forms UWP ASP.NET Xamarin UnityAzure ARM32 ARM64 ML.NET .NET for Apache Spark .NET – A unified platform (2019)
  • 4.
  • 5.
    What is notin .NET 5? • AppDomains, remoting, Web forms, WCF server and Windows workflow remain on .NET Framework 4.8 only • No plans to port… Add a footer 5
  • 6.
    Add a footer6 Target Framework Moniker
  • 7.
    Add a footer7 Simplified network names with .NET 5
  • 8.
    Add a footer8 What should you target?
  • 9.
    Add a footer9 The .NET SDK releases quarterly
  • 10.
    .NET Schedule (2019) •.NET Core 3.0 released today! • .NET Core 3.1 = Long Term Support (LTS) • .NET 5.0 release in November 2020 • Major releases every year, LTS for even numbered releases • Predictable schedule, minor releases if needed July 2019 .NET Core 3.0 RC Sept 2019 .NET Core 3.0 Nov 2019 .NET Core 3.1 LTS Nov 2020 .NET 5.0 Nov 2021 .NET 6.0 LTS Nov 2022 .NET 7.0 Nov 2023 .NET 8.0 LTS
  • 11.
    Visual Studio 201916.8 GA and 16.9 Preview • .NET 5.0 included • .NET productivity enhancements • Intellicode team completions • New Git experience • Linux debugging • Improved XAML experience • GitHub Actions in Visual Studio visualstudio.com/download aka.ms/vs-preview
  • 12.
    .NET 5 GeneralAvailability • Continued performance improvements • Windows ARM64 support • smaller container images • Single file applications (10 years after I played with reflection) • Web and cloud investments • Windows desktop development enhancements • New C# 9.0, F# 5.0 language features
  • 13.
    Three areas of interest …amongother s … Add a footer 13
  • 14.
    Full stack .NETweb apps with Blazor in .NET 5 • Supports Blazor Server & Blazor WebAssembly • Blazor WebAssembly enhancements • Now uses .NET 5 core framework libraries • 3X faster than previous release • Supports server-side prerendering & lazy loading dependencies • Component virtualization • CSS & JavaScript isolation • New components • Growing ecosystem of third-party & OSS controls and tools
  • 15.
    Windows desktop appson .NET 5 • Complete development experience • Windows Forms & WPF designers • Visual Studio tooling • Clickonce Installer support • Third-party tools & controls • All the benefits of .NET 5 • Self contained, single file EXEs • No need for .NET Framework on machine • Best performance • Modern controls like WebView2
  • 16.
  • 17.
  • 18.
  • 19.
    The third one Adda footer 19
  • 20.
    .NET adoption 200K Windows developersmigrated to .NET Core 230K First time .NET developers in September 2020 2 million Publishes per month to Linux from Visual Studio WinForms & WPF on .NET Core .NET Core .NET on Linux 5 million .NET developers Monthly active developers in Visual Studio Family
  • 21.
    .NET 5 performanceimprovements TechEmpower benchmarks perf increases for .NET 5 over .NET Core 3.1 +38% Plaintext +42% Json https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-5/
  • 22.
    .NET 5 performanceimprovements • +30% socket performance improvement on Linux over .NET Core 3.1 • JSON serialization performance improved +19% over .NET Core 3.11 • Serialization of large collections & arrays improved 3x and are now zero-alloc • gRPC server performance exceeds Go, C++ and Java2 1 All 104 JSON serialization benchmarks improved 2 https://github.com/LesnyRumcajs/grpc_bench/wiki/2020-08-11-bench-results 0 10000 20000 30000 40000 50000 60000 rust_tonic_mt dotnet_grpc go_grpc cpp_grpc_mt java_grpc gRPC Server Performance Requests/Sec (higher is better)
  • 23.
  • 24.
    And now… competing withOpen Source… from the dev POV Add a footer 24
  • 25.
    What’s new inC#9 Add a footer 25
  • 26.
    C# language evolution •C# 1.0 was a new managed language • C# 2.0 introduced generics • C# 3.0 enabled LINQ • C# 4.0 was all about interoperability with dynamic non-strongly typed languages. • C# 5.0 simplified asynchronous programming with the async and await keywords. • C# 6.0 the language has been increasingly shaped by conversation with the community, now to the point of taking language features as contributions from outside Microsoft • C# 7.x will be no exception, with tuples and pattern matching as the biggest features, transforming and streamlining the flow of data and control in code. Point releases • C# 7.1, 7.2, 7.3 Safe Efficient Code, More Freedom, Less Code • C# 8 running in the function path
  • 27.
    C# 7 objectives •Working with data • Pattern Matching • Tuples • Deconstruction • Discards • Code Simplification • Expression Bodied Properties, Constructor Finalizer • Throw expression • Out Variables • Binary Literals and Digit separator • Improved Performances • Local Functions • Return values and local variables by reference “Functional”
  • 28.
    What’s new inC# 8 • Default interface methods • Pattern matching enhancements: • Switch expressions • Property patterns • Tuple patterns • Positional patterns • Using declarations • Static local functions • Indices and ranges • Null-coalescing assignment • stackalloc in nested expressions “Pythonic” 
  • 29.
    .NET for ApacheSpark • .NET bindings (C# e F#) to Spark • Written on the Spark interop layer, designed to provide high performance bindings to multiple languages • Re-use knowledge, skills, code you have as a .NET developer • Compliant with .NET Standard • You can use .NET for Apache Spark anywhere you write .NET code • Original project Moebius • https://github.com/microsoft/Mobius
  • 30.
    Pythonizing C# (since C#7.x) Add a footer 30
  • 31.
    Guido Van Rossumjoins Microsoft
  • 32.
    Add a footer32 Top level statement • Only one file in a project the code you could write in a Main method directly without method and class • Else is a syntax error • You have no reference to that class (that is compiler generated) • …and it is async by default! 
  • 33.
    Add a footer33 Init-only setter • Use of object initializer as a constructor • But you need R/W propertiesMutability • In a world that is going to “immutability”
  • 34.
    Add a footer34 Record types • We had already immutabilityanonymous types • Anonymous types brought another featurestructural equivalence (implementing IEquatable<T> interface) • RECORDS!
  • 35.
    Add a footer35 Positional Records • The never implemented feature of principal constructor • In this case, only syntactic sugar • Only for record, not class • Most concise implementation for immutable record • Brings a Deconstruct implementation (that is positional!) • If you define explicily fields, it can be mutable
  • 36.
    Add a footer36 Improved pattern matching • Recap 7: • Adding value in switch statement • case 0: is the familiar constant pattern. • default: is the familiar default case. • New conditions • case IEnumerable<int> childSequence: is a type pattern. • case int n when n > 0: is a type pattern with an additional when condition. • case null: is the null pattern.
  • 37.
    Add a footer37 Improved pattern matching • Recap 8: • Switch expression • Arrow syntax (case and ‘:’ replaced by ‘=>’) • ‘default:’ replaced by the discard ‘_’ • Bodies are expressions non statement • Property pattern • location switch • { • { State: "WA" } => salePrice * 0.06M, • Tuple pattern • You apply switch statement to a tuple • (first, second) switch • { • ("rock", "paper") => "rock is covered by paper. Paper wins.", • Positional pattern • You apply tuple a switch expression condition to an object that support decostruction • point switch • { • (0, 0) => Quadrant.Origin, • var (x, y) when x > 0 && y > 0 => Quadrant.One,
  • 38.
    Add a footer38 Improved pattern matching • Now with C#9 • Type pattern (look! You don’t repeate variable!) • c is >= 'a' and <= 'z' or >= 'A' and <= ‘Z’; • Use parentesys • c is (>= 'a' and <= 'z') or (>= 'A' and <= 'Z') or '.' or ‘,’ • Null check! • e is not null
  • 39.
  • 40.
    Add a footer40 Conclusion • https://www.youtube.com/c/dotNET/videos

Editor's Notes

  • #12 Productivity Roslyn analyzers are now included in the .NET 5 SDK IntelliSense completion for DateTime and TimeSpan Inline parameter name hints With Intellicode team completions, you can train a custom model on your C# codebase & get starred contextual completion suggestions for your own types. New Git experience Quickly access your Git shortcuts with a new Git menu Easily execute your daily Git operations using the Git Changes window Fluidly browse and manage your Git repository and stop worrying about merge conflicts Linux Debugging Debug managed Linux core dump directly in Visual Studio .NET Core Debugging with WSL 2 using the Linux distro of your choice (Preview) XAML experience XAML Binding Failures diagnostic improvements XAML Hot Reload supports UWP GitHub Actions (Preview) - Generate a GitHub Actions workflow from within Visual Studio for your ASP.NET Core apps
  • #13 I’m pleased to announce the general availability of .NET 5. .NET 5 is the next version of .NET Core where we continue the journey of unifying the .NET platform. Our vision for one .NET is a unified set of libraries, tools/SDK and runtime. .NET 5 begins this with taking everything available in .NET Core and adding several cloud & web investments, such as smaller, faster single file apps that use less memory which are appropriate for microservices and containerized applications across operating systems. ASP.NET Blazor WebAssembly which allows you to write web UI in C# that runs completely in the browser, now uses the Core BCL (instead of Mono) further unifying the platform so developers can write code against the same base class libraries across all workloads. .NET 5 also embraces full Swagger support and makes it much easier to create testable, compatible, web APIs via OpenAPI. .NET 5 includes full design-time support for Windows Desktop development (WinForms and WPF) in Visual Studio, with first and third-party control support, Clickonce support, and side-by-side, single file deployment. There are also many runtime performance improvements, support for Windows ARM64, and new releases of languages C# 9.0 and F# 5.0. And a HUGE thank you to all the contributors that have made an incredible improvements to the .NET 5 release. Hundreds of thousands of contributions, in fact. Open web browser to: https://dotnetthanks.azurewebsites.net/ Go get it and start building! <CLICK>
  • #15 .NET 5 includes support for building full stack .NET web apps with Blazor Server & Blazor WebAssembly. Blazor WebAssembly apps now use the core framework libraries from .NET 5 giving access to the entire .NET 5 API surface area. Runtime performance in Blazor WebAssembly is two to three times faster than in the previous release. Blazor WebAssembly also now supports server-side prerendering and lazy loading of app dependencies. Other new Blazor features includes support for component virtualization, CSS isolation, JavaScript isolation, capturing JavaScript object refs, new components for radio button groups and file inputs, setting the UI focus, and many other improvements for building client-side web apps with C# instead of JavaScript.
  • #16 We know there are millions of Windows desktop applications out there written many years ago that are still business critical today that are being actively developed. We want to make sure these apps not only run on the latest .NET but can also be developed with the latest version of Visual Studio. That’s why we’ve worked to bring these workloads to .NET Core and now .NET 5. We already have over 200 thousand Windows developers moved from .NET Framework to .NET Core. With .NET 5, we’ve completed this work by bringing the full Visual Studio development experience to you, including third-party control and component vendors you may be using today, and clickonce installer support. By moving forward, these apps can get all the benefits of .NET 5 like self-contained, single file EXEs that don’t need the .NET Framework on the machine. You decide when you want to update, not the Windows OS. You can also use new, modern Windows 10 controls like WebView2, a modern browser control based on Microsoft Edge Chromium. <CLICK>
  • #21 And our user base keeps growing! There are over 5 million monthly active .NET developers in Visual Studio Family, which includes Visual Studio, Visual Studio Code, and Visual Studio for Mac. As I mentioned we’ve seen significant growth with .NET Core, our open source, cross-platform .NET, and it’s now surpassed 2 million active developers per month. We also are seeing a significant number of Windows desktop developers, 200 thousand, move to .NET Core from .NET Framework and we expect that to accelerate with .NET 5. Also super exciting is the number of first-time developers we’re seeing in use .NET. 230 thousand in September alone! And we continue to see about 2 million deployments per month to Linux from Visual Studio. <CLICK>
  • #22 But .NET 5 will be even faster in Round 20…. And not just in Plaintext benchmarks. We mirror the exact same hardware as Techempower and monitor a dashboard constantly with results from all the tests they perform. We predict we will have significant performance in many other areas as well. We’re seeing our internal Json benchmarks now beating Netty (Java) as well as seeing over 400K requests per second on the Fortunes tests beating the best Go framework out there. Fortunes is the most real-world test there is, as it also measures database access. These incredible results have been achieved because of a great collaboration between internal and external contributors.   <CLICK>
  • #23 Take a look at some of the details here on how we continue our investments in performance all the way up and down the stack. We’ve improved .NET 5 by 30% in socket performance on Linux over .NET Core 3.1. JSON serialization performance improved 19% over .NET Core 3.1. Serialization of large collections & arrays improved 3x and are now zero-alloc. gRPC server performance exceeds Go, C++ and Java as measured by a community run benchmark. These are some incredible results and we will not stop here. We intend to continue the focus on performance in .NET moving forward as well.