SlideShare a Scribd company logo
.NET Core
daenet Lead Architect, Microsoft Regional Director, Azure MVP
@ddobric
Damir Dobric
https://about.me/damirdobric
AGENDA
 Intro
 Building, Linking Optimizing
 Performance improvements
 Benchmark .NET
 Ref Types, Span<T>
 Assembly forwarding
 Global Tools
 .NET Core IoT (Pi)
 What is coming in .NET 3?
.NET Core is
a general purpose development platform
with cross-platform support for
Windows, macOS and Linux,
various devices and
cloud
https://docs.microsoft.com/en-us/dotnet/core/
https://github.com/dotnet/core/blob/master/microsoft-support.md
Welcome .NET Core 2.1.x
 Plattform support
 Windows Client: 7, 8.1, 10 (1607+)
 Windows Server: 2008 R2 SP1+
 macOS: 10.12+
 RHEL: 6+
 Fedora: 26+
 Ubuntu: 14.04+
 Debian: 8+
 SLES: 12+
 openSUSE: 42.3+
 Alpine: 3.7+
https://github.com/dotnet/core/blob/master/release-notes/2.1/2.1-supported-os.md
 Chip support
 x64 on:
 Windows,
 macOS,
 Linux
 x86 on
 Windows
 ARM32 on Linux (Ubuntu 18.04+, Debian 9+)
 VS 15.7
Building, Linking, Optimizing
Framework Dependent (FDD) vs. Self-Contained (SC)
>dotnet publish -c release -r win-x64 -o out
>dotnet publish -c release
FDD
SC
TRUE is default
Self-Contained publish with small footprint
>dotnet new nuget
<ItemGroup>
<PackageReference Include="ILLink.Tasks" Version="0.1.4-preview-906439" />
</ItemGroup>
>dotnet publish -c release -r win-x64 -o out-with-linker
/p:LinkDuringPublish=true /p:ShowLinkerSizeComparison=true
Generates details
related to linking
process
Required to
activate IL Linker
Activates v3 feed
with IL-Linker
ShowLinkerSizeComparison
100%
means not used at all.
0%
No optimization.
Most likely your own
code
Typical case. This app
use Console.
Performance Improvements
Build Performance Improvements
Runtime JIT Performance Improvements
 Devirtualization => Micro-optimization
 JIT is able to statically determine the target of some virtual invocations
 Avoid virtual dispatch costs and enable potential inlining
https://www.infoq.com/news/2017/12/Devirtualization
Runtime Performance Improvements
 String improvements
 String.Equal
 String.IndexOfAny
 String.ToLower, String.ToUpper
 String.Concat
 Formatting and Parsing
 String.Format
 Type.Parse
 Networking
 Parsing of URIs and IPAdresses
 HttpClient, Socket and SslStream
 File System
Runtime Thread Performance Improvements
 Access to thread static [ThreadStatic]
 Improves scalable code with access to thread statics.
 Timer Global lock optimization
 Improves creation of many timer
 Create/Dispose cancelation tokens
 Async/Await overhead reduced
https://blogs.msdn.microsoft.com/dotnet/2018/04/18/performance-improvements-in-net-core-2-1/
v2.0: 20.36 ns
v2.1: 13.48 ns
https://blogs.msdn.microsoft.com/dotnet/2018/04/18/performance-improvements-in-net-core-2-1/
https://github.com/dotnet/BenchmarkDotNet
C# 7.2
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<LangVersion>7.2</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<LangVersion>7.2</LangVersion>
</PropertyGroup>
C# 7.x
“Ref” returns
 A reference return value allows a method to return a reference to a
variable
public ref T this[int index] { get { ... } }
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/ref-returns
ref var value = ref store.FindNumber(number);
public ref int FindNumber(int target)
{
for (int ctr = 0; ctr < numbers.Length; ctr++)
{
if (numbers[ctr] >= target)
return ref numbers[ctr];
}
return ref numbers[0];
}
DEMO
Read Only Ref ‘in’ in C# 7.2, 7.3
Returning references
Span<T>
 ref T field in C# and MSIL
 Span<T> uses a special internal type in the runtime that’s treated as a
just-in-time (JIT) intrinsic
https://msdn.microsoft.com/en-us/magazine/mt814808.aspx
DEMO
New era of memory management
Span<T>
Windows Compatibility Pack
 20000 APIs
 Windows only
 Cross-platform
https://github.com/dotnet/docs/blob/master/docs/core/porting/windows-compat-pack.md
<ItemGroup>
<PackageReference
Include="Microsoft.Windows.Compatibility"
Version="2.0.0" />
</ItemGroup>
.NET Global Tools
Run tool
Tool can do anything
https://github.com/natemcmaster/dotnet-tools
.NET Global Tools
 Creat32e tool
 Pack:
 Find tool on web or Nuget.Org
 Install the tool.
 Location:
 Command:
 Call the tool.
 Update the tool.
 Uninstall the tool.
<PackAsTool>true</PackAsTool>
dotnet tool install -g toolsample
%USERPROFILE%.dotnettools $HOME/.dotnet/tools
toolsample
dotnet pack -c release -o nupkg
dotnet tool update -g toolsample
dotnet tool uninstall -g toolsample
https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools
Roll Forward
 .NET Core 2.N forwarded to .NET Core 2.N+M
 Example: .NET Core 2.1 -> .NET Core 2.3
 Example: .NET Core 2.1 -> .NET Core 3.0 (NOT SUPPORTED!)
 Minor versions only
 Doesn't occur between preview versions and release versions.
.NET Core & IoT
.NET Core for IoT
 ARM 32 support
 GPIO (planning)
 .NET Core GPIO support is coming
https://github.com/ianhays/corefxlab/blob/gpio/src/System.Devices.Gpio/Planning.md
 You can start now with GPIO in .NET Core
https://jeremylindsayni.wordpress.com/2017/05/01/controlling-gpio-pins-using-a-net-core-2-
webapi-on-a-raspberry-pi-using-windows-10-or-ubuntu/
 .NET Core on Raspberry 2+
 Setup Ubuntu
-https://ubuntu-mate.org/blog/ubuntu-mate-xenial-final-release
https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md
.NET Core on Linux (ARM 32)
https://blogs.msdn.microsoft.com/benjaminperkins/2017/10/18/create-a-net-core-2-application-on-linux-with-visual-studio-code/
https://developers.de/2018/06/06/setup-net-core-2-1-on-arm
$ sudo apt-get -y update
$ sudo apt-get -y install libunwind8 gettext
$ wget https://dotnetcli.blob.core.windows.net/dotnet/Sdk/2.1.300/dotnet-sdk-linux-arm.tar.gz
$ wget https://dotnetcli.blob.core.windows.net/dotnet/aspnetcore/Runtime/2.1.0/aspnetcore-runtime-2.1.0-linux-
arm.tar.gz $ sudo mkdir /opt/dotnet
$ sudo tar -xvf dotnet-sdk-2.1.300-linux-arm.tar.gz -C /opt/dotnet/
$ sudo tar -xvf aspnetcore-runtime-2.1.0-linux-arm.tar.gz -C /opt/dotnet/ $ sudo ln -s /opt/dotnet/dotnet /usr/local/bin
First look at .NET 3.0
Windows Forms and UWP in .NET Core
 Support for WinForms and WPF
 Apps can be self-contained and run in a single folder.
 XCOPY deployment
 No requirement to install anything
else (Self-Contained)
 C#, F#, VB
 Migration support from .NET 3.5
apps to .NET Core 3
 NO LINUX SUPPORT!
Recap
 V2.1 is RTM. Long Term Support
 Faster build
 Better Memory Management=>Performance Improvements
 Lot of micro-improvements (i.e.: devirtualization)
 IL Linker => Footprint optimization
 Span<TEverything>
 Global Tools are nuget packages. In .csproj <PackAsTool>true</PackAsTool>
 ARM 32 support. Runs on Raspberry PI 2+
 .NET 3.0:
 Self-contained assembly =>XCOPY
 WPF/WinForms
References
 Summary
 https://blogs.msdn.microsoft.com/dotnet/2018/05/30/announcing-net-core-2-1/
 Video .NET Core 2.1 and .NET Core 3
https://youtu.be/KAIJ3ezQb3c
 Setup .NET Core on ARM (PI)
 https://developers.de/2018/06/06/setup-net-core-2-1-on-arm
 IL Linker
 https://github.com/dotnet/core/blob/master/samples/linker-instructions.md
 GPIO Roadmap
 https://github.com/ianhays/corefxlab/blob/gpio/src/System.Devices.Gpio/Planning.md
 .NET Core on Linux with VS code
 https://blogs.msdn.microsoft.com/benjaminperkins/2017/10/18/create-a-net-core-2-
application-on-linux-with-visual-studio-code
Damir Dobric
https://about.me/damirdobric
Vielen Dank

Introduction to .NET Core
DEWX 2017
• Creating and deploying .NET core Applications
• .NET Standard
• Unit Testing .NET Core
• Migration
• Dependency Injection
• Logging
AGENDA
Creating and Running .NET Core applications
dotnet new console
dotnet restore
dotnet build
dotnet run
Deployment
Types of Deployment
 Framework Dependent
 Net Core Framework must be installed on the machine
 Small application footprint
 Framework Independent
 Net Core framework does not have to be installed
 Framework is installed (xcopy) with application binaries
 Bigger footprint
 Every application can use any kind of framework
Framework Dependent Application
 dotnet restore
 dotnet build
 dotnet publish -f netcoreapp2.0 -c Debug
Publish output
Framework Independent Application
dotnet publish -r win10-x64 --self-contained
<RuntimeIdentifiers>
win10-x64;osx.10.11-x64
</RuntimeIdentifiers>
Publish output
.NET Standard
What is .NET Standard?
The .NET Standard is an API spec that describes
the consistent set of .NET APIs that developers
can expect in each .NET implementation
https://github.com/dotnet/standard/blob/master/docs/versions.md
.NET Standard
 PCL is common lowest
denominator
 Standard is replacement for PCL
Which standard should I support?
1.0 2.0
NumberofAPIs
NumberofApplications
1.1 1.2 1.3 1.4 1.5 1.6
What should you know about Net Core?
.NET Standard
NetStandard 2.0
API Browser
https://apisof.net
Cross Referencing
 netstandard 2.0 -> netstandard 1.1,..,1.6
 net461 -> netstandard 2.0
error CS0012: The type 'Object' is defined in an assembly that is not
referenced. You must add a reference to assembly 'netstandard,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
 Net452 -> netstandard 2.0
error : Project “NetCoreLib2.csproj' targets '.NETStandard,Version=v2.0’.
It cannot be referenced by a project that targets
'.NETFramework,Version=v4.5.2’.
 ss
Referencing .NET Desktop
Unit Testing
Unit testing with XUnit
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
</ItemGroup>
Unit testing with MSTest
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.1.11" />
<PackageReference Include="MSTest.TestFramework" Version="1.1.11" />
</ItemGroup>
Test Execution
 dotnet test -h
 dotnet test --list-tests
 Execute specific tests
 dotnet test --filter "MessageOnly_LogsCorrectValues“
 dotnet test --filter Message -v d
 dotnet test --filter Message -v n
 dotnet test --filter Message -v d
 dotnet test --filter Message –filter ”Priority = 1”
Migration of .NET to .NET Core
API PORT ANALYZER
https://github.com/Microsoft/dotnet-apiport/
apiport analyze -f AddTokenGenDotNet.exe
Dependency Injection
• Inversion of Control IoC in 5 Min.
• Service Locator
• Dependency Injection
Arguments are injected in constructor
public class MySmsSender : ISmsProvider
{
private readonly SmsTradeSettings m_Settings;
private readonly ILogger m_Logger;
public SmsTradeSender(IOptions<SmsTradeSettings> options,
ILogger<SmsTradeSender> logger) :this(options.Value, logger)
{
}
public SmsTradeSender(SmsSettings settings, ILogger<MySmsSender> logger)
{
m_Settings = settings;
m_Logger = logger;
}
}
Required Packages
 Microsoft.Extensions.Configuration
 Microsoft.Extensions.Configuration.Binder
 Microsoft.Extensions.Configuration.Json
 Microsoft.Extensions.DependencyInjection
 Microsoft.Extensions.Options
Logging
Required Packages
 Microsoft.Extensions.Logging
 Microsoft.Extensions.Logging.Console
 Microsoft.Extensions.Logging.Debug
 Microsoft.Extensions.Logging.EventHub (*)
 …
How to build UI with .NET Core
 Graphic support overview
https://github.com/dotnet/corefx/issues/20325
 Open Source 2D Graphics Library
https://skia.org/
• Creating and deploying .NET core Applications
• .NET Standard
• Unit Testing .NET Core
• Migration
• Dependency Injection
• Logging
Recap
References
 .NET Core Guide:
 https://docs.microsoft.com/en-us/dotnet/core/
 Specification netstandard 2.0
 https://github.com/dotnet/standard/blob/master/docs/netstandard-20/README.md
 Building a C# Hello World Application with .NET Core in Visual Studio 2017 - Learn to to build,
debug, and publish a simple .NET Core console application using Visual Studio 2017.
 Building a class library with C# and .NET Core in Visual Studio 2017 - Learn how to build a class
library written in C# using Visual Studio 2017.
 Get started with Visual Studio Code using C# and .NET Core on Windows - This Channel9 video
shows you how to install and use Visual Studio Code, Microsoft's lightweight cross-platform code
editor, to create your first console application in .NET Core.
 Get Started with .NET Core and Visual Studio 2017 - This Channel9 video shows you how to install
and use Visual Studio 2017, Microsoft's fully-featured IDE, to create your first cross-platform console
application in .NET Core.
 Getting started with .NET Core using the command-line - Use any code editor with the .NET Core
cross-platform command-line interface (CLI).
Damir Dobric
https://about.me/damirdobric
Vielen Dank


More Related Content

What's hot (20)

PDF
Run Qt on Linux embedded systems using Yocto
Marco Cavallini
 
PDF
Learning notes on Open Source License
SZ Lin
 
PPTX
Software update for embedded systems
SZ Lin
 
PDF
Userspace drivers-2016
Chris Simmonds
 
PDF
Using open source software to build an industrial grade embedded linux platfo...
SZ Lin
 
PDF
Daneyon Hansen - Intro to OpenStack - Feb13 OpenStack Denver Meetup
Shannon McFarland
 
PDF
UplinQ - ubuntu linux on the qualcomm® snapdragon™ 600 processor
Satya Harish
 
PDF
Embedded Recipes 2019 - Testing firmware the devops way
Anne Nicolas
 
PDF
Memory Management in TIZEN - Samsung SW Platform Team
Ryo Jin
 
PDF
Coscup2018 itri android-in-cloud
Tian-Jian Wu
 
PDF
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Ron Munitz
 
PPTX
Open source Android 10 on Orange Pi: Meth or Reality?
GlobalLogic Ukraine
 
PPT
windows CE
bretorio
 
PDF
Embedded Recipes 2019 - RT is about to make it to mainline. Now what?
Anne Nicolas
 
PDF
Introduction to Civil Infrastructure Platform
SZ Lin
 
PDF
Software, Over the Air (SOTA) for Automotive Grade Linux (AGL)
Leon Anavi
 
PPTX
Upgrade Ubuntu 18.04 Security with Secureboot
Jonathan MICHEL-VILLAZ
 
PDF
P2P Container Image Distribution on IPFS With containerd and nerdctl
Kohei Tokunaga
 
PDF
Debugging embedded devices using GDB
Chris Simmonds
 
Run Qt on Linux embedded systems using Yocto
Marco Cavallini
 
Learning notes on Open Source License
SZ Lin
 
Software update for embedded systems
SZ Lin
 
Userspace drivers-2016
Chris Simmonds
 
Using open source software to build an industrial grade embedded linux platfo...
SZ Lin
 
Daneyon Hansen - Intro to OpenStack - Feb13 OpenStack Denver Meetup
Shannon McFarland
 
UplinQ - ubuntu linux on the qualcomm® snapdragon™ 600 processor
Satya Harish
 
Embedded Recipes 2019 - Testing firmware the devops way
Anne Nicolas
 
Memory Management in TIZEN - Samsung SW Platform Team
Ryo Jin
 
Coscup2018 itri android-in-cloud
Tian-Jian Wu
 
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Ron Munitz
 
Open source Android 10 on Orange Pi: Meth or Reality?
GlobalLogic Ukraine
 
windows CE
bretorio
 
Embedded Recipes 2019 - RT is about to make it to mainline. Now what?
Anne Nicolas
 
Introduction to Civil Infrastructure Platform
SZ Lin
 
Software, Over the Air (SOTA) for Automotive Grade Linux (AGL)
Leon Anavi
 
Upgrade Ubuntu 18.04 Security with Secureboot
Jonathan MICHEL-VILLAZ
 
P2P Container Image Distribution on IPFS With containerd and nerdctl
Kohei Tokunaga
 
Debugging embedded devices using GDB
Chris Simmonds
 

Similar to What should you know about Net Core? (20)

PDF
Raffaele Rialdi
CodeFest
 
PDF
ITCamp 2017 - Raffaele Rialdi - Adopting .NET Core in Mainstream Projects
ITCamp
 
PDF
.NET Core Blimey! Windows Platform User Group, Manchester
citizenmatt
 
PPTX
Tamir Dresher - Demystifying the Core of .NET Core
Tamir Dresher
 
PPTX
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
Karel Zikmund
 
PPTX
.NET MeetUp Amsterdam 2017 - .NET Standard -- Karel Zikmund
Karel Zikmund
 
PDF
.NET Core Blimey! (dotnetsheff Jan 2016)
citizenmatt
 
PDF
.NET Core, ASP.NET Core Course, Session 1
Amin Mesbahi
 
PDF
.Net framework vs .net core a complete comparison
Katy Slemon
 
PDF
.NET Core Blimey! (Shropshire Devs Mar 2016)
citizenmatt
 
PPTX
Academy PRO: .NET Core intro
Binary Studio
 
PPTX
O futuro do .NET : O que eu preciso saber
Danilo Bordini
 
PPTX
Unpacking .NET Core | EastBanc Technologies
EastBanc Tachnologies
 
PPTX
C#: Past, Present and Future
Rodolfo Finochietti
 
PDF
Asp.Net Core MVC , Razor page , Entity Framework Core
mohamed elshafey
 
PPTX
Net core
Damir Dobric
 
PDF
Learn .NET Core - Introduction
Eng Teong Cheah
 
PDF
Introduction to dot net
QIANG XU
 
PDF
.NET Everywhere and for Everyone
James Montemagno
 
PPTX
Overview of the new .NET Core and .NET Platform Standard
Alex Thissen
 
Raffaele Rialdi
CodeFest
 
ITCamp 2017 - Raffaele Rialdi - Adopting .NET Core in Mainstream Projects
ITCamp
 
.NET Core Blimey! Windows Platform User Group, Manchester
citizenmatt
 
Tamir Dresher - Demystifying the Core of .NET Core
Tamir Dresher
 
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
Karel Zikmund
 
.NET MeetUp Amsterdam 2017 - .NET Standard -- Karel Zikmund
Karel Zikmund
 
.NET Core Blimey! (dotnetsheff Jan 2016)
citizenmatt
 
.NET Core, ASP.NET Core Course, Session 1
Amin Mesbahi
 
.Net framework vs .net core a complete comparison
Katy Slemon
 
.NET Core Blimey! (Shropshire Devs Mar 2016)
citizenmatt
 
Academy PRO: .NET Core intro
Binary Studio
 
O futuro do .NET : O que eu preciso saber
Danilo Bordini
 
Unpacking .NET Core | EastBanc Technologies
EastBanc Tachnologies
 
C#: Past, Present and Future
Rodolfo Finochietti
 
Asp.Net Core MVC , Razor page , Entity Framework Core
mohamed elshafey
 
Net core
Damir Dobric
 
Learn .NET Core - Introduction
Eng Teong Cheah
 
Introduction to dot net
QIANG XU
 
.NET Everywhere and for Everyone
James Montemagno
 
Overview of the new .NET Core and .NET Platform Standard
Alex Thissen
 
Ad

More from Damir Dobric (20)

PPTX
Tools fuer ki and ml
Damir Dobric
 
PPTX
Ai zum anfassen
Damir Dobric
 
PPTX
Introduction to Cosmos db
Damir Dobric
 
PPTX
Ai zum anfassen
Damir Dobric
 
PPSX
AI for developers
Damir Dobric
 
PPTX
Microservices and modern backends - Azure Meetup Frankfurt
Damir Dobric
 
PPTX
Building Applications for HoloLens
Damir Dobric
 
PPTX
Key Steps in Developing .NET Core Applications
Damir Dobric
 
PPTX
IoT Ultimate Session
Damir Dobric
 
PPSX
Moderne backends mit dem aktor programmiermodell
Damir Dobric
 
PPTX
IoT with UWP, .NETCore and Azure
Damir Dobric
 
PPTX
Microsoft Io TechCamp Frankfurt am Main 2015
Damir Dobric
 
PPTX
Microservices and Azure App Services
Damir Dobric
 
PPTX
Azure Machine Learning Intro
Damir Dobric
 
PPTX
Internet of Things, Cloud & Co.
Damir Dobric
 
PPTX
Internet of Things & Co.
Damir Dobric
 
PPTX
IoT, connecting apps, devices and services
Damir Dobric
 
PPTX
Connecting Apps, Devices and Services
Damir Dobric
 
PPTX
Distributed systems witth Service Bus and Workflow Manager
Damir Dobric
 
PPTX
WinDays 2013 KeyNote Slides
Damir Dobric
 
Tools fuer ki and ml
Damir Dobric
 
Ai zum anfassen
Damir Dobric
 
Introduction to Cosmos db
Damir Dobric
 
Ai zum anfassen
Damir Dobric
 
AI for developers
Damir Dobric
 
Microservices and modern backends - Azure Meetup Frankfurt
Damir Dobric
 
Building Applications for HoloLens
Damir Dobric
 
Key Steps in Developing .NET Core Applications
Damir Dobric
 
IoT Ultimate Session
Damir Dobric
 
Moderne backends mit dem aktor programmiermodell
Damir Dobric
 
IoT with UWP, .NETCore and Azure
Damir Dobric
 
Microsoft Io TechCamp Frankfurt am Main 2015
Damir Dobric
 
Microservices and Azure App Services
Damir Dobric
 
Azure Machine Learning Intro
Damir Dobric
 
Internet of Things, Cloud & Co.
Damir Dobric
 
Internet of Things & Co.
Damir Dobric
 
IoT, connecting apps, devices and services
Damir Dobric
 
Connecting Apps, Devices and Services
Damir Dobric
 
Distributed systems witth Service Bus and Workflow Manager
Damir Dobric
 
WinDays 2013 KeyNote Slides
Damir Dobric
 
Ad

Recently uploaded (20)

PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
July Patch Tuesday
Ivanti
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Biography of Daniel Podor.pdf
Daniel Podor
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
July Patch Tuesday
Ivanti
 

What should you know about Net Core?

  • 1. .NET Core daenet Lead Architect, Microsoft Regional Director, Azure MVP @ddobric Damir Dobric https://about.me/damirdobric
  • 2. AGENDA  Intro  Building, Linking Optimizing  Performance improvements  Benchmark .NET  Ref Types, Span<T>  Assembly forwarding  Global Tools  .NET Core IoT (Pi)  What is coming in .NET 3?
  • 3. .NET Core is a general purpose development platform with cross-platform support for Windows, macOS and Linux, various devices and cloud https://docs.microsoft.com/en-us/dotnet/core/
  • 5. Welcome .NET Core 2.1.x  Plattform support  Windows Client: 7, 8.1, 10 (1607+)  Windows Server: 2008 R2 SP1+  macOS: 10.12+  RHEL: 6+  Fedora: 26+  Ubuntu: 14.04+  Debian: 8+  SLES: 12+  openSUSE: 42.3+  Alpine: 3.7+ https://github.com/dotnet/core/blob/master/release-notes/2.1/2.1-supported-os.md  Chip support  x64 on:  Windows,  macOS,  Linux  x86 on  Windows  ARM32 on Linux (Ubuntu 18.04+, Debian 9+)  VS 15.7
  • 7. Framework Dependent (FDD) vs. Self-Contained (SC) >dotnet publish -c release -r win-x64 -o out >dotnet publish -c release FDD SC
  • 8. TRUE is default Self-Contained publish with small footprint >dotnet new nuget <ItemGroup> <PackageReference Include="ILLink.Tasks" Version="0.1.4-preview-906439" /> </ItemGroup> >dotnet publish -c release -r win-x64 -o out-with-linker /p:LinkDuringPublish=true /p:ShowLinkerSizeComparison=true Generates details related to linking process Required to activate IL Linker Activates v3 feed with IL-Linker
  • 9. ShowLinkerSizeComparison 100% means not used at all. 0% No optimization. Most likely your own code Typical case. This app use Console.
  • 12. Runtime JIT Performance Improvements  Devirtualization => Micro-optimization  JIT is able to statically determine the target of some virtual invocations  Avoid virtual dispatch costs and enable potential inlining https://www.infoq.com/news/2017/12/Devirtualization
  • 13. Runtime Performance Improvements  String improvements  String.Equal  String.IndexOfAny  String.ToLower, String.ToUpper  String.Concat  Formatting and Parsing  String.Format  Type.Parse  Networking  Parsing of URIs and IPAdresses  HttpClient, Socket and SslStream  File System
  • 14. Runtime Thread Performance Improvements  Access to thread static [ThreadStatic]  Improves scalable code with access to thread statics.  Timer Global lock optimization  Improves creation of many timer  Create/Dispose cancelation tokens  Async/Await overhead reduced https://blogs.msdn.microsoft.com/dotnet/2018/04/18/performance-improvements-in-net-core-2-1/ v2.0: 20.36 ns v2.1: 13.48 ns
  • 16. C# 7.2 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <LangVersion>7.2</LangVersion> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <LangVersion>7.2</LangVersion> </PropertyGroup>
  • 18. “Ref” returns  A reference return value allows a method to return a reference to a variable public ref T this[int index] { get { ... } } https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/ref-returns ref var value = ref store.FindNumber(number); public ref int FindNumber(int target) { for (int ctr = 0; ctr < numbers.Length; ctr++) { if (numbers[ctr] >= target) return ref numbers[ctr]; } return ref numbers[0]; }
  • 19. DEMO Read Only Ref ‘in’ in C# 7.2, 7.3 Returning references
  • 20. Span<T>  ref T field in C# and MSIL  Span<T> uses a special internal type in the runtime that’s treated as a just-in-time (JIT) intrinsic https://msdn.microsoft.com/en-us/magazine/mt814808.aspx
  • 21. DEMO New era of memory management Span<T>
  • 22. Windows Compatibility Pack  20000 APIs  Windows only  Cross-platform https://github.com/dotnet/docs/blob/master/docs/core/porting/windows-compat-pack.md <ItemGroup> <PackageReference Include="Microsoft.Windows.Compatibility" Version="2.0.0" /> </ItemGroup>
  • 23. .NET Global Tools Run tool Tool can do anything https://github.com/natemcmaster/dotnet-tools
  • 24. .NET Global Tools  Creat32e tool  Pack:  Find tool on web or Nuget.Org  Install the tool.  Location:  Command:  Call the tool.  Update the tool.  Uninstall the tool. <PackAsTool>true</PackAsTool> dotnet tool install -g toolsample %USERPROFILE%.dotnettools $HOME/.dotnet/tools toolsample dotnet pack -c release -o nupkg dotnet tool update -g toolsample dotnet tool uninstall -g toolsample https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools
  • 25. Roll Forward  .NET Core 2.N forwarded to .NET Core 2.N+M  Example: .NET Core 2.1 -> .NET Core 2.3  Example: .NET Core 2.1 -> .NET Core 3.0 (NOT SUPPORTED!)  Minor versions only  Doesn't occur between preview versions and release versions.
  • 26. .NET Core & IoT
  • 27. .NET Core for IoT  ARM 32 support  GPIO (planning)  .NET Core GPIO support is coming https://github.com/ianhays/corefxlab/blob/gpio/src/System.Devices.Gpio/Planning.md  You can start now with GPIO in .NET Core https://jeremylindsayni.wordpress.com/2017/05/01/controlling-gpio-pins-using-a-net-core-2- webapi-on-a-raspberry-pi-using-windows-10-or-ubuntu/  .NET Core on Raspberry 2+  Setup Ubuntu -https://ubuntu-mate.org/blog/ubuntu-mate-xenial-final-release https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md
  • 28. .NET Core on Linux (ARM 32) https://blogs.msdn.microsoft.com/benjaminperkins/2017/10/18/create-a-net-core-2-application-on-linux-with-visual-studio-code/ https://developers.de/2018/06/06/setup-net-core-2-1-on-arm $ sudo apt-get -y update $ sudo apt-get -y install libunwind8 gettext $ wget https://dotnetcli.blob.core.windows.net/dotnet/Sdk/2.1.300/dotnet-sdk-linux-arm.tar.gz $ wget https://dotnetcli.blob.core.windows.net/dotnet/aspnetcore/Runtime/2.1.0/aspnetcore-runtime-2.1.0-linux- arm.tar.gz $ sudo mkdir /opt/dotnet $ sudo tar -xvf dotnet-sdk-2.1.300-linux-arm.tar.gz -C /opt/dotnet/ $ sudo tar -xvf aspnetcore-runtime-2.1.0-linux-arm.tar.gz -C /opt/dotnet/ $ sudo ln -s /opt/dotnet/dotnet /usr/local/bin
  • 29. First look at .NET 3.0
  • 30. Windows Forms and UWP in .NET Core  Support for WinForms and WPF  Apps can be self-contained and run in a single folder.  XCOPY deployment  No requirement to install anything else (Self-Contained)  C#, F#, VB  Migration support from .NET 3.5 apps to .NET Core 3  NO LINUX SUPPORT!
  • 31. Recap  V2.1 is RTM. Long Term Support  Faster build  Better Memory Management=>Performance Improvements  Lot of micro-improvements (i.e.: devirtualization)  IL Linker => Footprint optimization  Span<TEverything>  Global Tools are nuget packages. In .csproj <PackAsTool>true</PackAsTool>  ARM 32 support. Runs on Raspberry PI 2+  .NET 3.0:  Self-contained assembly =>XCOPY  WPF/WinForms
  • 32. References  Summary  https://blogs.msdn.microsoft.com/dotnet/2018/05/30/announcing-net-core-2-1/  Video .NET Core 2.1 and .NET Core 3 https://youtu.be/KAIJ3ezQb3c  Setup .NET Core on ARM (PI)  https://developers.de/2018/06/06/setup-net-core-2-1-on-arm  IL Linker  https://github.com/dotnet/core/blob/master/samples/linker-instructions.md  GPIO Roadmap  https://github.com/ianhays/corefxlab/blob/gpio/src/System.Devices.Gpio/Planning.md  .NET Core on Linux with VS code  https://blogs.msdn.microsoft.com/benjaminperkins/2017/10/18/create-a-net-core-2- application-on-linux-with-visual-studio-code
  • 34. Introduction to .NET Core DEWX 2017
  • 35. • Creating and deploying .NET core Applications • .NET Standard • Unit Testing .NET Core • Migration • Dependency Injection • Logging AGENDA
  • 36. Creating and Running .NET Core applications dotnet new console dotnet restore dotnet build dotnet run
  • 38. Types of Deployment  Framework Dependent  Net Core Framework must be installed on the machine  Small application footprint  Framework Independent  Net Core framework does not have to be installed  Framework is installed (xcopy) with application binaries  Bigger footprint  Every application can use any kind of framework
  • 39. Framework Dependent Application  dotnet restore  dotnet build  dotnet publish -f netcoreapp2.0 -c Debug
  • 41. Framework Independent Application dotnet publish -r win10-x64 --self-contained <RuntimeIdentifiers> win10-x64;osx.10.11-x64 </RuntimeIdentifiers>
  • 44. What is .NET Standard? The .NET Standard is an API spec that describes the consistent set of .NET APIs that developers can expect in each .NET implementation https://github.com/dotnet/standard/blob/master/docs/versions.md
  • 45. .NET Standard  PCL is common lowest denominator  Standard is replacement for PCL
  • 46. Which standard should I support? 1.0 2.0 NumberofAPIs NumberofApplications 1.1 1.2 1.3 1.4 1.5 1.6
  • 51. Cross Referencing  netstandard 2.0 -> netstandard 1.1,..,1.6  net461 -> netstandard 2.0 error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.  Net452 -> netstandard 2.0 error : Project “NetCoreLib2.csproj' targets '.NETStandard,Version=v2.0’. It cannot be referenced by a project that targets '.NETFramework,Version=v4.5.2’.  ss
  • 54. Unit testing with XUnit <ItemGroup> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" /> <PackageReference Include="xunit" Version="2.2.0" /> <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" /> </ItemGroup>
  • 55. Unit testing with MSTest <ItemGroup> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" /> <PackageReference Include="MSTest.TestAdapter" Version="1.1.11" /> <PackageReference Include="MSTest.TestFramework" Version="1.1.11" /> </ItemGroup>
  • 56. Test Execution  dotnet test -h  dotnet test --list-tests  Execute specific tests  dotnet test --filter "MessageOnly_LogsCorrectValues“  dotnet test --filter Message -v d  dotnet test --filter Message -v n  dotnet test --filter Message -v d  dotnet test --filter Message –filter ”Priority = 1”
  • 57. Migration of .NET to .NET Core
  • 59. Dependency Injection • Inversion of Control IoC in 5 Min. • Service Locator • Dependency Injection
  • 60. Arguments are injected in constructor public class MySmsSender : ISmsProvider { private readonly SmsTradeSettings m_Settings; private readonly ILogger m_Logger; public SmsTradeSender(IOptions<SmsTradeSettings> options, ILogger<SmsTradeSender> logger) :this(options.Value, logger) { } public SmsTradeSender(SmsSettings settings, ILogger<MySmsSender> logger) { m_Settings = settings; m_Logger = logger; } }
  • 61. Required Packages  Microsoft.Extensions.Configuration  Microsoft.Extensions.Configuration.Binder  Microsoft.Extensions.Configuration.Json  Microsoft.Extensions.DependencyInjection  Microsoft.Extensions.Options
  • 63. Required Packages  Microsoft.Extensions.Logging  Microsoft.Extensions.Logging.Console  Microsoft.Extensions.Logging.Debug  Microsoft.Extensions.Logging.EventHub (*)  …
  • 64. How to build UI with .NET Core  Graphic support overview https://github.com/dotnet/corefx/issues/20325  Open Source 2D Graphics Library https://skia.org/
  • 65. • Creating and deploying .NET core Applications • .NET Standard • Unit Testing .NET Core • Migration • Dependency Injection • Logging Recap
  • 66. References  .NET Core Guide:  https://docs.microsoft.com/en-us/dotnet/core/  Specification netstandard 2.0  https://github.com/dotnet/standard/blob/master/docs/netstandard-20/README.md  Building a C# Hello World Application with .NET Core in Visual Studio 2017 - Learn to to build, debug, and publish a simple .NET Core console application using Visual Studio 2017.  Building a class library with C# and .NET Core in Visual Studio 2017 - Learn how to build a class library written in C# using Visual Studio 2017.  Get started with Visual Studio Code using C# and .NET Core on Windows - This Channel9 video shows you how to install and use Visual Studio Code, Microsoft's lightweight cross-platform code editor, to create your first console application in .NET Core.  Get Started with .NET Core and Visual Studio 2017 - This Channel9 video shows you how to install and use Visual Studio 2017, Microsoft's fully-featured IDE, to create your first cross-platform console application in .NET Core.  Getting started with .NET Core using the command-line - Use any code editor with the .NET Core cross-platform command-line interface (CLI).

Editor's Notes