.NET
Past - Present - Future
@DenisVoituron
Denis Voituron
.NET Architect @ Oniryx.be
Podcasteur @ DevApps.ms
Blogger @ dvoituron.com
Evolution of .NET
2011
2010
2009
2008
2007
2006
2005
2004
2003
2002 2016
2015
2014
2013
2012 2019
2018
2017
Version 1.0 Version 2.0 Version 3.5 Version 4.5
Version 1.1 Version 3.0 Version 4.0 Version 4.6 Version 4.8
Version 4.7
.NET Framework
Evolution of .NET
.NET Framework
.NET Core
Mono
.NET Standard
Evolution of .NET
.NET Framework
Mono
.NET Core
.NET Standard
.NET 5 .NET 6
.NET Core
2021
2020
2019
2018
2016
https://dotnet.microsoft.com
.NET Core 4.0
mai 2018
2.1
décembre 2018
2.2
décembre 2019
3.1
novembre 2020
5.0
4.8
avril 2019
4.7
avril 2018
4.6
juillet 2015
Platform
Common Language Runtime (CLR)
Dynamic Language Runtime
Base Class Libraries
C# VB.NET F#
Common Language Specification
Visual Studio
Visual Studio for Mac
Visual Studio Code
Command Line
https://en.wikipedia.org/wiki/List_of_CLI_languages
Unified platform
.NET Standard
.NET 5
Infrastructure
Runtime components Languages
Compilers
https://docs.microsoft.com/en-us/dotnet/core/introduction
DESKTOP
WPF
Windows Forms
UWP
WEB
ASP.NET
CLOUD
Azure
MOBILE
Xamarin
GAMING
Unity
IoT
ARM32
ARM64
AI
ML.NET
.NET for
Apache Spark
Visual Studio
Visual Studio for Mac
Visual Studio Code
Command Line
Demo
Thank you & have fun
@DenisVoituron
https://dvoituron.com
DotNet Command
Help
Template
Core
{
"sdk": {
"version": "5.0.301"
}
}
Dependency injection Core
Dependency injection
public class MainViewModel
{
public MainViewModel()
{
_dataService = new DataService();
}
}
public class MainViewModel
{
public MainViewModel(IDataService dataservice)
{
_dataService = dataservice;
}
}
• Responsible for creating services when needed
• Responsible for injecting them
• Responsible for caching them
• Access provider
Core
Target frameworkds Core
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net5.0;net5.0-windows</TargetFrameworks>
</PropertyGroup>
</Project>
https://docs.microsoft.com/en-us/dotnet/standard/frameworks
Slow to publish
Null Conditional Operators
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/member-access-operators#null-conditional-operators--and-
C# 6
string message = null;
// Warning: dereference null.
Console.WriteLine($"Length is {message?.Length}");
message = "Hello, World!";
// No warning. Analysis determined "message" is not null.
Console.WriteLine($"Length is {message?.Length}");
Nullable Reference Types
https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8#nullable-reference-types
C# 8
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
<Version>1.2</Version>
</PropertyGroup>
String? message = null;
// Warning: dereference null.
Console.WriteLine($"Length is {message?.Length}");
message = "Hello, World!";
// No warning. Analysis determined "message" is not null.
Console.WriteLine($"Length is {message?.Length}");
Local Functions
https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8#static-local-functions
C# 7
public void Run()
{
string path = "C:Windows";
string filename = "WindowsUpdate.log";
var file = new FileInfo(AppendPathSeparator(path) + filename);
var reader = File.OpenText(file.FullName);
var text = reader.ReadToEnd();
Console.WriteLine(text);
string AppendPathSeparator(string filepath)
{
return filepath.EndsWith(@"") ? filepath : filepath + @"";
}
}
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/init
C# 9
Init – Object construction only
public class Person
{
public Person()
public Person(string firstname,
string lastname)
{
FirstName = firstname;
LastName = lastname;
}
public string? FirstName { get; init; }
public string? LastName { get; init; }
}
Person denis = new Person("Denis",
"Voituron");
Person anne = new();
Person smith = new()
{
FirstName = "Mr",
LastName = "Smith"
};
Records - Object to be immutable (~ value type)
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record
C# 9
public record Person
{
public Person(string firstname,
string lastname)
{
FirstName = firstname;
LastName = lastname;
}
public string? FirstName { get; init; }
public string? LastName { get; init; }
}
var denis = new Person("Denis", "Voituron");
var me = new Person("Denis", "Voituron");
var smith = new Person("Mr", "Smith");
var anne = denis with { FirstName = "Anne" };
Console.WriteLine($"Denis == Me ? {denis == me}");
Console.WriteLine($"Denis == Smith ? {denis == smith}");
Console.WriteLine($"Denis == Anne ? {denis == anne}");
Console.WriteLine($"Denis => {denis}");
Top Level program & Global
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record
Global using System.Math;
using System;
namespace MyApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
using System;
Console.WriteLine("Hello World!");
C# 10
C# 9
Thank you & have fun
@DenisVoituron
https://dvoituron.com

.Net passé, présent et futur

  • 1.
    .NET Past - Present- Future @DenisVoituron
  • 2.
    Denis Voituron .NET Architect@ Oniryx.be Podcasteur @ DevApps.ms Blogger @ dvoituron.com
  • 3.
    Evolution of .NET 2011 2010 2009 2008 2007 2006 2005 2004 2003 20022016 2015 2014 2013 2012 2019 2018 2017 Version 1.0 Version 2.0 Version 3.5 Version 4.5 Version 1.1 Version 3.0 Version 4.0 Version 4.6 Version 4.8 Version 4.7 .NET Framework
  • 4.
    Evolution of .NET .NETFramework .NET Core Mono .NET Standard
  • 5.
    Evolution of .NET .NETFramework Mono .NET Core .NET Standard .NET 5 .NET 6
  • 6.
    .NET Core 2021 2020 2019 2018 2016 https://dotnet.microsoft.com .NET Core4.0 mai 2018 2.1 décembre 2018 2.2 décembre 2019 3.1 novembre 2020 5.0 4.8 avril 2019 4.7 avril 2018 4.6 juillet 2015
  • 7.
    Platform Common Language Runtime(CLR) Dynamic Language Runtime Base Class Libraries C# VB.NET F# Common Language Specification Visual Studio Visual Studio for Mac Visual Studio Code Command Line https://en.wikipedia.org/wiki/List_of_CLI_languages
  • 8.
    Unified platform .NET Standard .NET5 Infrastructure Runtime components Languages Compilers https://docs.microsoft.com/en-us/dotnet/core/introduction DESKTOP WPF Windows Forms UWP WEB ASP.NET CLOUD Azure MOBILE Xamarin GAMING Unity IoT ARM32 ARM64 AI ML.NET .NET for Apache Spark Visual Studio Visual Studio for Mac Visual Studio Code Command Line
  • 9.
  • 10.
    Thank you &have fun @DenisVoituron https://dvoituron.com
  • 11.
  • 12.
  • 13.
    Dependency injection public classMainViewModel { public MainViewModel() { _dataService = new DataService(); } } public class MainViewModel { public MainViewModel(IDataService dataservice) { _dataService = dataservice; } } • Responsible for creating services when needed • Responsible for injecting them • Responsible for caching them • Access provider Core
  • 14.
    Target frameworkds Core <ProjectSdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFrameworks>net5.0;net5.0-windows</TargetFrameworks> </PropertyGroup> </Project> https://docs.microsoft.com/en-us/dotnet/standard/frameworks Slow to publish
  • 15.
    Null Conditional Operators https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/member-access-operators#null-conditional-operators--and- C#6 string message = null; // Warning: dereference null. Console.WriteLine($"Length is {message?.Length}"); message = "Hello, World!"; // No warning. Analysis determined "message" is not null. Console.WriteLine($"Length is {message?.Length}");
  • 16.
    Nullable Reference Types https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8#nullable-reference-types C#8 <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net5.0</TargetFramework> <LangVersion>8.0</LangVersion> <Nullable>enable</Nullable> <Version>1.2</Version> </PropertyGroup> String? message = null; // Warning: dereference null. Console.WriteLine($"Length is {message?.Length}"); message = "Hello, World!"; // No warning. Analysis determined "message" is not null. Console.WriteLine($"Length is {message?.Length}");
  • 17.
    Local Functions https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8#static-local-functions C# 7 publicvoid Run() { string path = "C:Windows"; string filename = "WindowsUpdate.log"; var file = new FileInfo(AppendPathSeparator(path) + filename); var reader = File.OpenText(file.FullName); var text = reader.ReadToEnd(); Console.WriteLine(text); string AppendPathSeparator(string filepath) { return filepath.EndsWith(@"") ? filepath : filepath + @""; } }
  • 18.
    https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/init C# 9 Init –Object construction only public class Person { public Person() public Person(string firstname, string lastname) { FirstName = firstname; LastName = lastname; } public string? FirstName { get; init; } public string? LastName { get; init; } } Person denis = new Person("Denis", "Voituron"); Person anne = new(); Person smith = new() { FirstName = "Mr", LastName = "Smith" };
  • 19.
    Records - Objectto be immutable (~ value type) https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record C# 9 public record Person { public Person(string firstname, string lastname) { FirstName = firstname; LastName = lastname; } public string? FirstName { get; init; } public string? LastName { get; init; } } var denis = new Person("Denis", "Voituron"); var me = new Person("Denis", "Voituron"); var smith = new Person("Mr", "Smith"); var anne = denis with { FirstName = "Anne" }; Console.WriteLine($"Denis == Me ? {denis == me}"); Console.WriteLine($"Denis == Smith ? {denis == smith}"); Console.WriteLine($"Denis == Anne ? {denis == anne}"); Console.WriteLine($"Denis => {denis}");
  • 20.
    Top Level program& Global https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record Global using System.Math; using System; namespace MyApp { class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); } } } using System; Console.WriteLine("Hello World!"); C# 10 C# 9
  • 21.
    Thank you &have fun @DenisVoituron https://dvoituron.com