SlideShare a Scribd company logo
1 of 25
.Net Standard 2.0
dotnetConf.Local Bengaluru – Nov 18, 2017
@svswaminathan
Swaminathan Vetri
Lead Engineer @ JCPenney
Microsoft MVP - Visual Studio &
Development technologies
Windows/Web/Cross platform mobile
developer
Blogger, Speaker, Amateur
photographer, Gadget freak
@svswaminathan Wannabeegeek.com 2
Agenda
• What is .Net Standard ?
• Why .Net Standard ?
• .Net standard vs PCL
• Porting existing libraries to .Net Standard
• Demos
• Creating a new .netstandard library
• Consuming .netstandard library in various .net implementations
• Porting existing libraries to .netstandard library
3
What is .NET Standard?
• .NET Standard is a specification
• A set of APIs that all .NET platforms have to implement
.NET Standard
.NET Framework
.NET Core
Xamarin
~
~
HTML specification
Browsers
4
Why .Net Standard ????
5
.NET today—reusing code
6
.NET today—reusing code
Difficult to reuse skills
• Need to master 3+1 base class libraries
Difficult to reuse code
• Need to target a fairly small common
denominator
Difficult to innovate
• Need implementations on each platform
7
.NET tomorrow
.NET Standard
8
.NET tomorrow
.NET Standard
Reuse skills
• Master one BCL, not a Venn diagram
Reuse code
• Common denominator is much bigger
Faster innovation
• Target .NET Standard & run anywhere
9
Difference to Portable Class Libraries (PCL)
• PCLs were an after thought, i.e. each platform could decide which
APIs to includes
• No systematic approach to versioning
• Computed intersection profiles
• Each PCLs is targeting a specific set of
platforms
• Not compatible with newer platforms
• Hard to understand compatibility relationships
Platform 3Platform 1
Platform 2
Intersection
Profiles 10
2.0
1.6
1.3
Versioning in .NET Standard
• Higher versions incorporate all
APIs from previous versions.
• Projects targeting version X.Y can
reference libraries & projects
targeting any version between 1.0
and X.Y
• Concrete .NET platforms
implement a specific version of
.NET Standard
• From that platform you can
reference libraries up to that version
1.0
11
What version should you target?
• The higher the version, the more APIs you have
• The lower the version, the more platforms support it
Lower Version
More Reach
Higher Version
More APIs
12
.NET Implementation Support
Source : https://docs.microsoft.com/en-us/dotnet/standard/net-standard 13
Demo
14
• .NET Standard is represented by
• The NuGet package NetStandard.Library which contains the reference
assembly netstandard.dll
• At build time
• .NET Standard bridges references to existing .NET Framework and PCL
assemblies via type forwarding
• At runtime
• Each platform provides an implementation for netstandard.dll that
type forwards to its implementation
How does .NET Standard work?
15
What can you reference from .NET
Standard?
My Standard Library 2.x
.NET Standard Library .NET Framework LibraryPortable Class Library
.NET FRAMEWORK .NET CORE XAMARIN
Via Portability
Via Compatibility Shim
Legend
Application Type
Is able to reference
16
.NET Standard under the hood
TYPE
FORWARDING
This happens when you build a .NET Standard-based Library
17
.NET Standard under the hood
TYPE
FORWARDING
This happens when you load .NET Standard-based library
18
• .NET Standard (mostly) only contains APIs that will work everywhere
• We generally avoid adding large chunks of APIs that don’t work everywhere
• A small set of APIs will throw PlatformNotSupportedException
• Platform specific APIs sit on top of .NET Standard & you can add
references to them
• Examples: Registry, Reflection Emit, Access Control, Windows Identity
• You’ll become less portable
Platform specific APIs & .NET Standard
19
Platform specific APIs & .NET Standard
TYPE
FORWARDING
This happens when you build a .NET Standard-based library with platform-specific extensions
TYPE
FORWARDING
20
Platform specific APIs & .NET Standard
This happens when you load .NET Standard-based library with platform-specific extensions
EXCEPTION
TYPE
FORWARDING
21
.NET Standard API Statistics
22
Porting Existing libraries
• APIPORT.exe – API porting analyzer to check what percentage of
existing DLLs are compatibility
• .Net Portability analyzer – Visual Studio Extension to analyze the
source code for compatibility
• Tools to check the .NET API availability/compatibility
• http://apisof.net
• http://icanhasdot.net
• API Analyzer – to check the cross platform compatibility of APIs
23
References
• https://blogs.msdn.microsoft.com/dotnet/2016/09/26/introducing-
net-standard/
• https://docs.microsoft.com/en-us/dotnet/standard/net-standard
• https://github.com/dotnet/standard
• https://gist.github.com/davidfowl/8939f305567e1755412d6dc0b8baf
1b7
• https://www.youtube.com/playlist?list=PLRAdsfhKI4OWx321A_pr-
7HhRNk7wOLLY
• https://github.com/dotnet/standard/blob/master/docs/faq.md
• https://github.com/Microsoft/dotnet-apiport
• http://immo.landwerth.net/netstandard-versions/#
24
Thank you.
Swaminathan Vetri
Microsoft MVP
swami@wannabeegeek.com @svswaminathan
Questions?

More Related Content

What's hot

.Net Core Blimey! (16/07/2015)
.Net Core Blimey! (16/07/2015).Net Core Blimey! (16/07/2015)
.Net Core Blimey! (16/07/2015)citizenmatt
 
ASP.NET Session 1
ASP.NET Session 1ASP.NET Session 1
ASP.NET Session 1Sisir Ghosh
 
.NET Core Blimey! (Shropshire Devs Mar 2016)
.NET Core Blimey! (Shropshire Devs Mar 2016).NET Core Blimey! (Shropshire Devs Mar 2016)
.NET Core Blimey! (Shropshire Devs Mar 2016)citizenmatt
 
.NET Core Blimey! (dotnetsheff Jan 2016)
.NET Core Blimey! (dotnetsheff Jan 2016).NET Core Blimey! (dotnetsheff Jan 2016)
.NET Core Blimey! (dotnetsheff Jan 2016)citizenmatt
 
DotNet Framework
DotNet FrameworkDotNet Framework
DotNet FrameworkWani Zahoor
 
C# code sharing across the platforms
C# code sharing across the platformsC# code sharing across the platforms
C# code sharing across the platformsAndrei Marukovich
 
Components of .NET Framework
Components of .NET FrameworkComponents of .NET Framework
Components of .NET FrameworkRoshith S Pai
 
Component of .net
Component of .netComponent of .net
Component of .netSireesh K
 
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel Zikmund
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel ZikmundDotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel Zikmund
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel ZikmundKarel Zikmund
 
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...GlobalLogic Ukraine
 
.net Core Blimey - Smart Devs UG
.net Core Blimey - Smart Devs UG.net Core Blimey - Smart Devs UG
.net Core Blimey - Smart Devs UGcitizenmatt
 
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0Antonio Chagoury
 
Mozilla: Mozmill meets L10n
Mozilla: Mozmill meets L10nMozilla: Mozmill meets L10n
Mozilla: Mozmill meets L10nHenrik Skupin
 
Moving 1,000 Users & 100 Branches into Streams
Moving 1,000 Users & 100 Branches into StreamsMoving 1,000 Users & 100 Branches into Streams
Moving 1,000 Users & 100 Branches into StreamsPerforce
 

What's hot (20)

.Net Core Blimey! (16/07/2015)
.Net Core Blimey! (16/07/2015).Net Core Blimey! (16/07/2015)
.Net Core Blimey! (16/07/2015)
 
ASP.NET Session 1
ASP.NET Session 1ASP.NET Session 1
ASP.NET Session 1
 
.NET Core Blimey! (Shropshire Devs Mar 2016)
.NET Core Blimey! (Shropshire Devs Mar 2016).NET Core Blimey! (Shropshire Devs Mar 2016)
.NET Core Blimey! (Shropshire Devs Mar 2016)
 
.NET Core Blimey! (dotnetsheff Jan 2016)
.NET Core Blimey! (dotnetsheff Jan 2016).NET Core Blimey! (dotnetsheff Jan 2016)
.NET Core Blimey! (dotnetsheff Jan 2016)
 
DotNet Framework
DotNet FrameworkDotNet Framework
DotNet Framework
 
C# code sharing across the platforms
C# code sharing across the platformsC# code sharing across the platforms
C# code sharing across the platforms
 
Why Kotlin?
Why Kotlin?Why Kotlin?
Why Kotlin?
 
Components of .NET Framework
Components of .NET FrameworkComponents of .NET Framework
Components of .NET Framework
 
Net framework
Net frameworkNet framework
Net framework
 
1.0
1.01.0
1.0
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
 
Vpm
VpmVpm
Vpm
 
Component of .net
Component of .netComponent of .net
Component of .net
 
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel Zikmund
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel ZikmundDotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel Zikmund
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel Zikmund
 
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...
 
.net Core Blimey - Smart Devs UG
.net Core Blimey - Smart Devs UG.net Core Blimey - Smart Devs UG
.net Core Blimey - Smart Devs UG
 
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
 
Mozilla: Mozmill meets L10n
Mozilla: Mozmill meets L10nMozilla: Mozmill meets L10n
Mozilla: Mozmill meets L10n
 
.Net Introduction
.Net Introduction.Net Introduction
.Net Introduction
 
Moving 1,000 Users & 100 Branches into Streams
Moving 1,000 Users & 100 Branches into StreamsMoving 1,000 Users & 100 Branches into Streams
Moving 1,000 Users & 100 Branches into Streams
 

Similar to .Net Standard 2.0

The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)citizenmatt
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele RialdiCodeFest
 
Whats new in .net for 2019
Whats new in .net for 2019Whats new in .net for 2019
Whats new in .net for 2019Rory Preddy
 
Introduction to dot net
Introduction to dot netIntroduction to dot net
Introduction to dot netQIANG XU
 
Whats new in .NET for 2019
Whats new in .NET for 2019Whats new in .NET for 2019
Whats new in .NET for 2019Rory Preddy
 
.NET Core, ASP.NET Core Course, Session 1
.NET Core, ASP.NET Core Course, Session 1.NET Core, ASP.NET Core Course, Session 1
.NET Core, ASP.NET Core Course, Session 1aminmesbahi
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesVagif Abilov
 
.NET MeetUp Amsterdam 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - .NET Standard -- Karel Zikmund.NET MeetUp Amsterdam 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - .NET Standard -- Karel ZikmundKarel Zikmund
 
ASP.NET 5 - Microsoft's Web development platform reimagined
ASP.NET 5 - Microsoft's Web development platform reimaginedASP.NET 5 - Microsoft's Web development platform reimagined
ASP.NET 5 - Microsoft's Web development platform reimaginedAlex Thissen
 
Unboxing ASP.NET Core
Unboxing ASP.NET CoreUnboxing ASP.NET Core
Unboxing ASP.NET CoreKevin Leung
 
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel ZikmundKarel Zikmund
 
ASP.NET Core: The best of the new bits
ASP.NET Core: The best of the new bitsASP.NET Core: The best of the new bits
ASP.NET Core: The best of the new bitsKen Cenerelli
 
Porting Projects to .NET 5
Porting Projects to .NET 5Porting Projects to .NET 5
Porting Projects to .NET 5Immo Landwerth
 
.NET Core, ASP.NET Core Course, Session 2
.NET Core, ASP.NET Core Course, Session 2.NET Core, ASP.NET Core Course, Session 2
.NET Core, ASP.NET Core Course, Session 2aminmesbahi
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Coremohamed elshafey
 
.Net Core 3.0. What’s inside? Павло Голубович
.Net Core 3.0. What’s inside? Павло Голубович.Net Core 3.0. What’s inside? Павло Голубович
.Net Core 3.0. What’s inside? Павло ГолубовичSigma Software
 
AWS Summit Auckland - Moving MS .NET Applications One Container at a Time
AWS Summit Auckland - Moving MS .NET Applications One Container at a TimeAWS Summit Auckland - Moving MS .NET Applications One Container at a Time
AWS Summit Auckland - Moving MS .NET Applications One Container at a TimeAmazon Web Services
 
Native App Development for iOS, Android, and Windows with Visual Studio
Native App Development for iOS, Android, and Windows with Visual StudioNative App Development for iOS, Android, and Windows with Visual Studio
Native App Development for iOS, Android, and Windows with Visual StudioXamarin
 

Similar to .Net Standard 2.0 (20)

The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele Rialdi
 
Whats new in .net for 2019
Whats new in .net for 2019Whats new in .net for 2019
Whats new in .net for 2019
 
Modern .NET Ecosystem
Modern .NET EcosystemModern .NET Ecosystem
Modern .NET Ecosystem
 
Introduction to dot net
Introduction to dot netIntroduction to dot net
Introduction to dot net
 
Whats new in .NET for 2019
Whats new in .NET for 2019Whats new in .NET for 2019
Whats new in .NET for 2019
 
.NET Core, ASP.NET Core Course, Session 1
.NET Core, ASP.NET Core Course, Session 1.NET Core, ASP.NET Core Course, Session 1
.NET Core, ASP.NET Core Course, Session 1
 
C#: Past, Present and Future
C#: Past, Present and FutureC#: Past, Present and Future
C#: Past, Present and Future
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class Libraries
 
.NET MeetUp Amsterdam 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - .NET Standard -- Karel Zikmund.NET MeetUp Amsterdam 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - .NET Standard -- Karel Zikmund
 
ASP.NET 5 - Microsoft's Web development platform reimagined
ASP.NET 5 - Microsoft's Web development platform reimaginedASP.NET 5 - Microsoft's Web development platform reimagined
ASP.NET 5 - Microsoft's Web development platform reimagined
 
Unboxing ASP.NET Core
Unboxing ASP.NET CoreUnboxing ASP.NET Core
Unboxing ASP.NET Core
 
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
 
ASP.NET Core: The best of the new bits
ASP.NET Core: The best of the new bitsASP.NET Core: The best of the new bits
ASP.NET Core: The best of the new bits
 
Porting Projects to .NET 5
Porting Projects to .NET 5Porting Projects to .NET 5
Porting Projects to .NET 5
 
.NET Core, ASP.NET Core Course, Session 2
.NET Core, ASP.NET Core Course, Session 2.NET Core, ASP.NET Core Course, Session 2
.NET Core, ASP.NET Core Course, Session 2
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Core
 
.Net Core 3.0. What’s inside? Павло Голубович
.Net Core 3.0. What’s inside? Павло Голубович.Net Core 3.0. What’s inside? Павло Голубович
.Net Core 3.0. What’s inside? Павло Голубович
 
AWS Summit Auckland - Moving MS .NET Applications One Container at a Time
AWS Summit Auckland - Moving MS .NET Applications One Container at a TimeAWS Summit Auckland - Moving MS .NET Applications One Container at a Time
AWS Summit Auckland - Moving MS .NET Applications One Container at a Time
 
Native App Development for iOS, Android, and Windows with Visual Studio
Native App Development for iOS, Android, and Windows with Visual StudioNative App Development for iOS, Android, and Windows with Visual Studio
Native App Development for iOS, Android, and Windows with Visual Studio
 

More from Swaminathan Vetri

Architecting multi-cloud ready applications
Architecting multi-cloud ready applicationsArchitecting multi-cloud ready applications
Architecting multi-cloud ready applicationsSwaminathan Vetri
 
BDotNet - Microsoft Build 2023 After Party
BDotNet - Microsoft Build 2023 After Party BDotNet - Microsoft Build 2023 After Party
BDotNet - Microsoft Build 2023 After Party Swaminathan Vetri
 
AzureContainerAppswithDotNet_Pune_2022.pptx
AzureContainerAppswithDotNet_Pune_2022.pptxAzureContainerAppswithDotNet_Pune_2022.pptx
AzureContainerAppswithDotNet_Pune_2022.pptxSwaminathan Vetri
 
Microservices and Service Mesh
Microservices and Service MeshMicroservices and Service Mesh
Microservices and Service MeshSwaminathan Vetri
 
Infrastructure automation with .NET
Infrastructure automation with .NETInfrastructure automation with .NET
Infrastructure automation with .NETSwaminathan Vetri
 
Azure infra automation using pulumi
Azure infra automation using pulumiAzure infra automation using pulumi
Azure infra automation using pulumiSwaminathan Vetri
 
Cross platform dotnet development using dotnet core
Cross platform dotnet development using dotnet coreCross platform dotnet development using dotnet core
Cross platform dotnet development using dotnet coreSwaminathan Vetri
 
Unicom DevCon - CI/CD for Asp.net core apps using Docker
Unicom DevCon - CI/CD for Asp.net core apps using DockerUnicom DevCon - CI/CD for Asp.net core apps using Docker
Unicom DevCon - CI/CD for Asp.net core apps using DockerSwaminathan Vetri
 
CI/CD for Asp.net core apps using Docker
CI/CD for Asp.net core apps using DockerCI/CD for Asp.net core apps using Docker
CI/CD for Asp.net core apps using DockerSwaminathan Vetri
 
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruDeploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruSwaminathan Vetri
 
Rapid mobile app development using Ionic framework
Rapid mobile app development using Ionic frameworkRapid mobile app development using Ionic framework
Rapid mobile app development using Ionic frameworkSwaminathan Vetri
 
Entity Framework for Cross platform apps
Entity Framework for Cross platform appsEntity Framework for Cross platform apps
Entity Framework for Cross platform appsSwaminathan Vetri
 
Xamarin Dev Days - Intro to Xamarin
Xamarin Dev Days - Intro to XamarinXamarin Dev Days - Intro to Xamarin
Xamarin Dev Days - Intro to XamarinSwaminathan Vetri
 

More from Swaminathan Vetri (18)

Architecting multi-cloud ready applications
Architecting multi-cloud ready applicationsArchitecting multi-cloud ready applications
Architecting multi-cloud ready applications
 
BDotNet - Microsoft Build 2023 After Party
BDotNet - Microsoft Build 2023 After Party BDotNet - Microsoft Build 2023 After Party
BDotNet - Microsoft Build 2023 After Party
 
AzureContainerAppswithDotNet_Pune_2022.pptx
AzureContainerAppswithDotNet_Pune_2022.pptxAzureContainerAppswithDotNet_Pune_2022.pptx
AzureContainerAppswithDotNet_Pune_2022.pptx
 
Microservices and Service Mesh
Microservices and Service MeshMicroservices and Service Mesh
Microservices and Service Mesh
 
Infrastructure automation with .NET
Infrastructure automation with .NETInfrastructure automation with .NET
Infrastructure automation with .NET
 
Azure infra automation using pulumi
Azure infra automation using pulumiAzure infra automation using pulumi
Azure infra automation using pulumi
 
CI/CD with GitHub Actions
CI/CD with GitHub ActionsCI/CD with GitHub Actions
CI/CD with GitHub Actions
 
Bye bye WCF, hello gRPC
Bye bye WCF, hello gRPCBye bye WCF, hello gRPC
Bye bye WCF, hello gRPC
 
Building cloud native apps
Building cloud native appsBuilding cloud native apps
Building cloud native apps
 
Azure dev ops
Azure dev opsAzure dev ops
Azure dev ops
 
Cross platform dotnet development using dotnet core
Cross platform dotnet development using dotnet coreCross platform dotnet development using dotnet core
Cross platform dotnet development using dotnet core
 
Unicom DevCon - CI/CD for Asp.net core apps using Docker
Unicom DevCon - CI/CD for Asp.net core apps using DockerUnicom DevCon - CI/CD for Asp.net core apps using Docker
Unicom DevCon - CI/CD for Asp.net core apps using Docker
 
CI/CD for Asp.net core apps using Docker
CI/CD for Asp.net core apps using DockerCI/CD for Asp.net core apps using Docker
CI/CD for Asp.net core apps using Docker
 
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruDeploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
 
Rapid mobile app development using Ionic framework
Rapid mobile app development using Ionic frameworkRapid mobile app development using Ionic framework
Rapid mobile app development using Ionic framework
 
Entity Framework for Cross platform apps
Entity Framework for Cross platform appsEntity Framework for Cross platform apps
Entity Framework for Cross platform apps
 
Xamarin Dev Days - Intro to Xamarin
Xamarin Dev Days - Intro to XamarinXamarin Dev Days - Intro to Xamarin
Xamarin Dev Days - Intro to Xamarin
 
Getting Started with Ionic
Getting Started with IonicGetting Started with Ionic
Getting Started with Ionic
 

Recently uploaded

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 

Recently uploaded (20)

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 

.Net Standard 2.0

  • 1. .Net Standard 2.0 dotnetConf.Local Bengaluru – Nov 18, 2017 @svswaminathan
  • 2. Swaminathan Vetri Lead Engineer @ JCPenney Microsoft MVP - Visual Studio & Development technologies Windows/Web/Cross platform mobile developer Blogger, Speaker, Amateur photographer, Gadget freak @svswaminathan Wannabeegeek.com 2
  • 3. Agenda • What is .Net Standard ? • Why .Net Standard ? • .Net standard vs PCL • Porting existing libraries to .Net Standard • Demos • Creating a new .netstandard library • Consuming .netstandard library in various .net implementations • Porting existing libraries to .netstandard library 3
  • 4. What is .NET Standard? • .NET Standard is a specification • A set of APIs that all .NET platforms have to implement .NET Standard .NET Framework .NET Core Xamarin ~ ~ HTML specification Browsers 4
  • 7. .NET today—reusing code Difficult to reuse skills • Need to master 3+1 base class libraries Difficult to reuse code • Need to target a fairly small common denominator Difficult to innovate • Need implementations on each platform 7
  • 9. .NET tomorrow .NET Standard Reuse skills • Master one BCL, not a Venn diagram Reuse code • Common denominator is much bigger Faster innovation • Target .NET Standard & run anywhere 9
  • 10. Difference to Portable Class Libraries (PCL) • PCLs were an after thought, i.e. each platform could decide which APIs to includes • No systematic approach to versioning • Computed intersection profiles • Each PCLs is targeting a specific set of platforms • Not compatible with newer platforms • Hard to understand compatibility relationships Platform 3Platform 1 Platform 2 Intersection Profiles 10
  • 11. 2.0 1.6 1.3 Versioning in .NET Standard • Higher versions incorporate all APIs from previous versions. • Projects targeting version X.Y can reference libraries & projects targeting any version between 1.0 and X.Y • Concrete .NET platforms implement a specific version of .NET Standard • From that platform you can reference libraries up to that version 1.0 11
  • 12. What version should you target? • The higher the version, the more APIs you have • The lower the version, the more platforms support it Lower Version More Reach Higher Version More APIs 12
  • 13. .NET Implementation Support Source : https://docs.microsoft.com/en-us/dotnet/standard/net-standard 13
  • 15. • .NET Standard is represented by • The NuGet package NetStandard.Library which contains the reference assembly netstandard.dll • At build time • .NET Standard bridges references to existing .NET Framework and PCL assemblies via type forwarding • At runtime • Each platform provides an implementation for netstandard.dll that type forwards to its implementation How does .NET Standard work? 15
  • 16. What can you reference from .NET Standard? My Standard Library 2.x .NET Standard Library .NET Framework LibraryPortable Class Library .NET FRAMEWORK .NET CORE XAMARIN Via Portability Via Compatibility Shim Legend Application Type Is able to reference 16
  • 17. .NET Standard under the hood TYPE FORWARDING This happens when you build a .NET Standard-based Library 17
  • 18. .NET Standard under the hood TYPE FORWARDING This happens when you load .NET Standard-based library 18
  • 19. • .NET Standard (mostly) only contains APIs that will work everywhere • We generally avoid adding large chunks of APIs that don’t work everywhere • A small set of APIs will throw PlatformNotSupportedException • Platform specific APIs sit on top of .NET Standard & you can add references to them • Examples: Registry, Reflection Emit, Access Control, Windows Identity • You’ll become less portable Platform specific APIs & .NET Standard 19
  • 20. Platform specific APIs & .NET Standard TYPE FORWARDING This happens when you build a .NET Standard-based library with platform-specific extensions TYPE FORWARDING 20
  • 21. Platform specific APIs & .NET Standard This happens when you load .NET Standard-based library with platform-specific extensions EXCEPTION TYPE FORWARDING 21
  • 22. .NET Standard API Statistics 22
  • 23. Porting Existing libraries • APIPORT.exe – API porting analyzer to check what percentage of existing DLLs are compatibility • .Net Portability analyzer – Visual Studio Extension to analyze the source code for compatibility • Tools to check the .NET API availability/compatibility • http://apisof.net • http://icanhasdot.net • API Analyzer – to check the cross platform compatibility of APIs 23
  • 24. References • https://blogs.msdn.microsoft.com/dotnet/2016/09/26/introducing- net-standard/ • https://docs.microsoft.com/en-us/dotnet/standard/net-standard • https://github.com/dotnet/standard • https://gist.github.com/davidfowl/8939f305567e1755412d6dc0b8baf 1b7 • https://www.youtube.com/playlist?list=PLRAdsfhKI4OWx321A_pr- 7HhRNk7wOLLY • https://github.com/dotnet/standard/blob/master/docs/faq.md • https://github.com/Microsoft/dotnet-apiport • http://immo.landwerth.net/netstandard-versions/# 24
  • 25. Thank you. Swaminathan Vetri Microsoft MVP swami@wannabeegeek.com @svswaminathan Questions?

Editor's Notes

  1. Notes: Even if we are reusing a lot across components (especially with the open sourcing last year), the reality is that each platform has its own implementation of the base libraries. Note: .NET Framework BCL and Mono BCL are the same APIs, different implementation. .NET Core “Core Library” is a similar set of APIs, but different.
  2. Notes: Even if we are reusing a lot across components (especially with the open sourcing last year), the reality is that each platform has its own implementation of the base libraries. Note: .NET Framework BCL and Mono BCL are the same APIs, different implementation. .NET Core “Core Library” is a similar set of APIs, but different.
  3. Notes: Even if we are reusing a lot across components (especially with the open sourcing last year), the reality is that each platform has its own implementation of the base libraries. Note: .NET Framework BCL and Mono BCL are the same APIs, different implementation. .NET Core “Core Library” is a similar set of APIs, but different.
  4. Notes: Even if we are reusing a lot across components (especially with the open sourcing last year), the reality is that each platform has its own implementation of the base libraries. Note: .NET Framework BCL and Mono BCL are the same APIs, different implementation. .NET Core “Core Library” is a similar set of APIs, but different.
  5. New APIs will first become available in specific .NET platforms, such as .NET Core. If the .NET Standard review board believes the new APIs should be made available everywhere, they'll be added in a new .NET Standard version.
  6. At build time, .Net standard library bridges references to existing .net framework and PCL libraries by type forwarding
  7. At runtime, each platform’s .net standard implementation will type forward to its corresponding implementation