SlideShare uma empresa Scribd logo
.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?

Mais conteúdo relacionado

Mais procurados

.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 Framework
Wani Zahoor
 
C# code sharing across the platforms
C# code sharing across the platformsC# code sharing across the platforms
C# code sharing across the platforms
Andrei Marukovich
 
Why Kotlin?
Why Kotlin?Why Kotlin?
Why Kotlin?
Yongqiang Li
 
Components of .NET Framework
Components of .NET FrameworkComponents of .NET Framework
Components of .NET Framework
Roshith S Pai
 
Net framework
Net frameworkNet framework
Net framework
Saiteja Kaparthi
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
SubashiniRathinavel
 
Component of .net
Component of .netComponent of .net
Component of .net
Sireesh 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 Zikmund
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...
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 UG
citizenmatt
 
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
Antonio Chagoury
 
Mozilla: Mozmill meets L10n
Mozilla: Mozmill meets L10nMozilla: Mozmill meets L10n
Mozilla: Mozmill meets L10n
Henrik Skupin
 
.Net Introduction
.Net Introduction.Net Introduction
.Net Introduction
Muzzammil Wani
 
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
Perforce
 

Mais procurados (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
 

Semelhante a .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 Rialdi
CodeFest
 
Whats new in .net for 2019
Whats new in .net for 2019Whats new in .net for 2019
Whats new in .net for 2019
Rory Preddy
 
Modern .NET Ecosystem
Modern .NET EcosystemModern .NET Ecosystem
Modern .NET Ecosystem
Andrei Marukovich
 
Introduction to dot net
Introduction to dot netIntroduction to dot net
Introduction to dot net
QIANG XU
 
Whats new in .NET for 2019
Whats new in .NET for 2019Whats new in .NET for 2019
Whats new in .NET for 2019
Rory 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 1
aminmesbahi
 
C#: Past, Present and Future
C#: Past, Present and FutureC#: Past, Present and Future
C#: Past, Present and Future
Rodolfo Finochietti
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class Libraries
Vagif 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 Zikmund
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
Alex Thissen
 
Unboxing ASP.NET Core
Unboxing ASP.NET CoreUnboxing ASP.NET Core
Unboxing ASP.NET Core
Kevin 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 Zikmund
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
Ken Cenerelli
 
Porting Projects to .NET 5
Porting Projects to .NET 5Porting Projects to .NET 5
Porting Projects to .NET 5
Immo 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 2
aminmesbahi
 
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
mohamed 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 Time
Amazon 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 Studio
Xamarin
 

Semelhante a .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
 

Mais de Swaminathan Vetri

Architecting multi-cloud ready applications
Architecting multi-cloud ready applicationsArchitecting multi-cloud ready applications
Architecting multi-cloud ready applications
Swaminathan 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.pptx
Swaminathan Vetri
 
Microservices and Service Mesh
Microservices and Service MeshMicroservices and Service Mesh
Microservices and Service Mesh
Swaminathan Vetri
 
Infrastructure automation with .NET
Infrastructure automation with .NETInfrastructure automation with .NET
Infrastructure automation with .NET
Swaminathan Vetri
 
Azure infra automation using pulumi
Azure infra automation using pulumiAzure infra automation using pulumi
Azure infra automation using pulumi
Swaminathan Vetri
 
CI/CD with GitHub Actions
CI/CD with GitHub ActionsCI/CD with GitHub Actions
CI/CD with GitHub Actions
Swaminathan Vetri
 
Bye bye WCF, hello gRPC
Bye bye WCF, hello gRPCBye bye WCF, hello gRPC
Bye bye WCF, hello gRPC
Swaminathan Vetri
 
Building cloud native apps
Building cloud native appsBuilding cloud native apps
Building cloud native apps
Swaminathan Vetri
 
Azure dev ops
Azure dev opsAzure dev ops
Azure dev ops
Swaminathan 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 core
Swaminathan 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 Docker
Swaminathan 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 Docker
Swaminathan 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 Bengaluru
Swaminathan 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 framework
Swaminathan Vetri
 
Entity Framework for Cross platform apps
Entity Framework for Cross platform appsEntity Framework for Cross platform apps
Entity Framework for Cross platform apps
Swaminathan Vetri
 
Xamarin Dev Days - Intro to Xamarin
Xamarin Dev Days - Intro to XamarinXamarin Dev Days - Intro to Xamarin
Xamarin Dev Days - Intro to Xamarin
Swaminathan Vetri
 
Getting Started with Ionic
Getting Started with IonicGetting Started with Ionic
Getting Started with Ionic
Swaminathan Vetri
 

Mais de 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
 

Último

Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 

Último (20)

Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 

.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?

Notas do Editor

  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