SlideShare a Scribd company logo
1 of 19
C# code sharing across the platforms
Andrei Marukovich
LunarFrog.com
twitter: @amarukovich
.NET ecosystem
.NET Framework .NET Core Xamarin
WPF
ASP.NET
WinForms UWP
ASP.NET Core
iOS
macOS
Android
Code sharing strategies
• Source file links
• Shared projects
• Portable class libraries (PCLs)
• .NET Standard
Shared projects
• Better version of the source file links
UWP project Xamarin project
File1.cs
File2.cs
SharedLib
File1.cs
File2.cs
SharedLib
File1.cs
File2.cs
SharedLibUI
App layer
UI
App layer
Shared projects
Shared projects
• Benefits
• Simple model
• May include platform-specific code
• Disadvantages
• Source-level sharing, no assembly
• Compiler directives
• Usability
Portable class libraries
• Sharing code in binary form, without recompiling
UWP project Xamarin project
File1.cs
File2.cs
PortableLib
UI
App layer
UI
App layer
How it works?
• PCLs are based on profiles
• Profile defines an API surface supported by the library
• Profile is identified by combination of supported platforms
• http://embed.plnkr.co/03ck2dCtnJogBKHJ9EjY
• C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETPortable
UWP
Profile API surface
Xamarin
Android
.NET
Framework
PCLs
Portable class libraries
• Benefits
• PCLs allow binary distribution
• API enforcement
• No context switching, simple refactoring
• Disadvantages
• PCL’s require upfront decision on the supported platforms
• Lowest common denominator for the selected platforms
• Cannot use compiler directives
• Long term maintainability
.NET Standard
• An evolution of PCLs
• .NET Standard defines a set of APIs to be implemented by .NET
platforms (specification)
• .NET Standard is versioned (API level)
• Library developers may choose target .NET Standard version
• Version defines API surface, not supported frameworks
• The higher the version, the more APIs you have
• The lower the version, the more .NET platforms implement it
• Analogy: https://gist.github.com/davidfowl/8939f305567e1755412d6dc0b8baf1b7
.NET Standard
.NET platform support
.NET Standard 2.0
Big picture
.NET Standard
• Current state
• Tooling is in preview
• Currently PCLs support a wider range of platforms
• At the moment, PCL adoption (# of libraries) is higher than .NET Standard
• Future
• PCL replacement
• Standard 2.0 will have significantly larger API surface
• Standard 2.0 will be interoperable with .NET Framework
More information
• github.com/dotnet/standard
Thank you!
Andrei Marukovich
contact@lunarfrog.com
twitter: @amarukovich

More Related Content

What's hot

.NET Standard - Under the Hood
.NET Standard - Under the Hood.NET Standard - Under the Hood
.NET Standard - Under the HoodImmo Landwerth
 
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
 
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel ZikmundKarel Zikmund
 
Building apps with common code for windows 8 and windows phone 8 (WP8)
Building apps with common code for windows 8 and windows phone 8 (WP8)Building apps with common code for windows 8 and windows phone 8 (WP8)
Building apps with common code for windows 8 and windows phone 8 (WP8)Tamir Dresher
 
Microsoft .Net Framework
Microsoft .Net FrameworkMicrosoft .Net Framework
Microsoft .Net FrameworkRohit Rao
 
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHERE
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHEREECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHERE
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHEREEuropean Collaboration Summit
 
Que hay de nuevo en 2013 en la plataforma Microsoft para desarrolladores
Que hay de nuevo en 2013 en la plataforma Microsoft para desarrolladoresQue hay de nuevo en 2013 en la plataforma Microsoft para desarrolladores
Que hay de nuevo en 2013 en la plataforma Microsoft para desarrolladoresRodolfo Finochietti
 
Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#SharePointKE
 
Five Real-World Strategies for Perforce Streams
Five Real-World Strategies for Perforce StreamsFive Real-World Strategies for Perforce Streams
Five Real-World Strategies for Perforce StreamsPerforce
 
.Net framework
.Net framework.Net framework
.Net frameworksanya6900
 
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...Ken Cenerelli
 
Accelerating time to delivery modern tools for cobol development
Accelerating time to delivery modern tools for cobol developmentAccelerating time to delivery modern tools for cobol development
Accelerating time to delivery modern tools for cobol developmentMicro Focus
 
Recipy presentation #collabw15
Recipy presentation #collabw15Recipy presentation #collabw15
Recipy presentation #collabw15Raquel Alegre
 
Product Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical SkillsProduct Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical SkillsSandeep Adwankar
 
The Python in the Apple
The Python in the AppleThe Python in the Apple
The Python in the ApplezeroSteiner
 

What's hot (20)

.NET Standard - Under the Hood
.NET Standard - Under the Hood.NET Standard - Under the Hood
.NET Standard - Under the Hood
 
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
 
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
 
Building apps with common code for windows 8 and windows phone 8 (WP8)
Building apps with common code for windows 8 and windows phone 8 (WP8)Building apps with common code for windows 8 and windows phone 8 (WP8)
Building apps with common code for windows 8 and windows phone 8 (WP8)
 
Microsoft .Net Framework
Microsoft .Net FrameworkMicrosoft .Net Framework
Microsoft .Net Framework
 
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHERE
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHEREECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHERE
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHERE
 
Que hay de nuevo en 2013 en la plataforma Microsoft para desarrolladores
Que hay de nuevo en 2013 en la plataforma Microsoft para desarrolladoresQue hay de nuevo en 2013 en la plataforma Microsoft para desarrolladores
Que hay de nuevo en 2013 en la plataforma Microsoft para desarrolladores
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
 
Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#
 
Five Real-World Strategies for Perforce Streams
Five Real-World Strategies for Perforce StreamsFive Real-World Strategies for Perforce Streams
Five Real-World Strategies for Perforce Streams
 
Manas
ManasManas
Manas
 
Presentation1
Presentation1Presentation1
Presentation1
 
.Net framework
.Net framework.Net framework
.Net framework
 
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
 
Accelerating time to delivery modern tools for cobol development
Accelerating time to delivery modern tools for cobol developmentAccelerating time to delivery modern tools for cobol development
Accelerating time to delivery modern tools for cobol development
 
Recipy presentation #collabw15
Recipy presentation #collabw15Recipy presentation #collabw15
Recipy presentation #collabw15
 
.NET - The Current Spectrum
.NET -  The Current Spectrum.NET -  The Current Spectrum
.NET - The Current Spectrum
 
Product Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical SkillsProduct Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical Skills
 
The Python in the Apple
The Python in the AppleThe Python in the Apple
The Python in the Apple
 
Dot Net Core
Dot Net CoreDot Net Core
Dot Net Core
 

Viewers also liked

[3] silabus pai sma xi
[3] silabus pai sma xi[3] silabus pai sma xi
[3] silabus pai sma xiawalsepta84
 
Atmik_Soni_Resume
Atmik_Soni_ResumeAtmik_Soni_Resume
Atmik_Soni_ResumeAtmik Soni
 
Atoosa Samiei-Resume
Atoosa Samiei-ResumeAtoosa Samiei-Resume
Atoosa Samiei-ResumeAtoosa Samiei
 
ATIK SHEIKH(Resume) (1)
ATIK SHEIKH(Resume) (1)ATIK SHEIKH(Resume) (1)
ATIK SHEIKH(Resume) (1)Atik Sheikh
 
Business models
Business modelsBusiness models
Business modelsVJIMPGDM
 
Environmental complexity
Environmental complexityEnvironmental complexity
Environmental complexityVJIMPGDM
 
Biomedical waste management ppt final1
Biomedical waste management ppt final1Biomedical waste management ppt final1
Biomedical waste management ppt final1rashmi123vaish
 
Safety health and environment aspects in thermal power plants
Safety health and environment aspects in thermal power plantsSafety health and environment aspects in thermal power plants
Safety health and environment aspects in thermal power plantsVudugundla Kodandapani
 
Principle & Applications of Transmission Electron Microscopy (TEM) & High Res...
Principle & Applications of Transmission Electron Microscopy (TEM) & High Res...Principle & Applications of Transmission Electron Microscopy (TEM) & High Res...
Principle & Applications of Transmission Electron Microscopy (TEM) & High Res...Gulfam Raza
 

Viewers also liked (14)

[3] silabus pai sma xi
[3] silabus pai sma xi[3] silabus pai sma xi
[3] silabus pai sma xi
 
Atul's Resume
Atul's ResumeAtul's Resume
Atul's Resume
 
Atmik_Soni_Resume
Atmik_Soni_ResumeAtmik_Soni_Resume
Atmik_Soni_Resume
 
Atoosa Samiei-Resume
Atoosa Samiei-ResumeAtoosa Samiei-Resume
Atoosa Samiei-Resume
 
ATIK SHEIKH(Resume) (1)
ATIK SHEIKH(Resume) (1)ATIK SHEIKH(Resume) (1)
ATIK SHEIKH(Resume) (1)
 
Business models
Business modelsBusiness models
Business models
 
Biomedical Waste Management
Biomedical Waste ManagementBiomedical Waste Management
Biomedical Waste Management
 
Makalah Sambiloto
Makalah Sambiloto Makalah Sambiloto
Makalah Sambiloto
 
Efusi pleura
Efusi pleuraEfusi pleura
Efusi pleura
 
Alzheimer's disease: Genetic Aspects
Alzheimer's disease: Genetic AspectsAlzheimer's disease: Genetic Aspects
Alzheimer's disease: Genetic Aspects
 
Environmental complexity
Environmental complexityEnvironmental complexity
Environmental complexity
 
Biomedical waste management ppt final1
Biomedical waste management ppt final1Biomedical waste management ppt final1
Biomedical waste management ppt final1
 
Safety health and environment aspects in thermal power plants
Safety health and environment aspects in thermal power plantsSafety health and environment aspects in thermal power plants
Safety health and environment aspects in thermal power plants
 
Principle & Applications of Transmission Electron Microscopy (TEM) & High Res...
Principle & Applications of Transmission Electron Microscopy (TEM) & High Res...Principle & Applications of Transmission Electron Microscopy (TEM) & High Res...
Principle & Applications of Transmission Electron Microscopy (TEM) & High Res...
 

Similar to C# code sharing across the platforms

Whats new in .net for 2019
Whats new in .net for 2019Whats new in .net for 2019
Whats new in .net for 2019Rory Preddy
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele RialdiCodeFest
 
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
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesVagif Abilov
 
Introduction to dot net
Introduction to dot netIntroduction to dot net
Introduction to dot netQIANG XU
 
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
 
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
 
Unboxing ASP.NET Core
Unboxing ASP.NET CoreUnboxing ASP.NET Core
Unboxing ASP.NET CoreKevin Leung
 
.Net Core Fall update
.Net Core Fall update.Net Core Fall update
.Net Core Fall updateMSDEVMTL
 
.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
 
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
Lessons learned from building Eclipse-based add-ons for commercial modeling t...Lessons learned from building Eclipse-based add-ons for commercial modeling t...
Lessons learned from building Eclipse-based add-ons for commercial modeling t...IncQuery Labs
 
.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
 
Porting Projects to .NET 5
Porting Projects to .NET 5Porting Projects to .NET 5
Porting Projects to .NET 5Immo Landwerth
 

Similar to C# code sharing across the platforms (20)

Whats new in .net for 2019
Whats new in .net for 2019Whats new in .net for 2019
Whats new in .net for 2019
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele Rialdi
 
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
 
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
 
Introduction to dot net
Introduction to dot netIntroduction to dot net
Introduction to dot net
 
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
 
Top 10 web application development frameworks 2016
Top 10 web application development frameworks 2016Top 10 web application development frameworks 2016
Top 10 web application development frameworks 2016
 
Dotnet.ppt
Dotnet.pptDotnet.ppt
Dotnet.ppt
 
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)
 
Best DotNet Training in Delhi
Best   DotNet Training  in DelhiBest   DotNet Training  in Delhi
Best DotNet Training in Delhi
 
Unboxing ASP.NET Core
Unboxing ASP.NET CoreUnboxing ASP.NET Core
Unboxing ASP.NET Core
 
.Net Core Fall update
.Net Core Fall update.Net Core Fall update
.Net Core Fall update
 
.NET Core Blimey! (dotnetsheff Jan 2016)
.NET Core Blimey! (dotnetsheff Jan 2016).NET Core Blimey! (dotnetsheff Jan 2016)
.NET Core Blimey! (dotnetsheff Jan 2016)
 
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
Lessons learned from building Eclipse-based add-ons for commercial modeling t...Lessons learned from building Eclipse-based add-ons for commercial modeling t...
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
 
.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? Павло Голубович
 
Apache Cordova 4.x
Apache Cordova 4.xApache Cordova 4.x
Apache Cordova 4.x
 
Mini .net conf 2020
Mini .net conf 2020Mini .net conf 2020
Mini .net conf 2020
 
.NET (r)evolution
.NET (r)evolution.NET (r)evolution
.NET (r)evolution
 
Porting Projects to .NET 5
Porting Projects to .NET 5Porting Projects to .NET 5
Porting Projects to .NET 5
 

More from Andrei Marukovich

Using NuGet libraries in your application
Using NuGet libraries in your applicationUsing NuGet libraries in your application
Using NuGet libraries in your applicationAndrei Marukovich
 
Open Source Libraries for.NET developers
Open Source Libraries for.NET developersOpen Source Libraries for.NET developers
Open Source Libraries for.NET developersAndrei Marukovich
 
Reactive Extensions for .NET
Reactive Extensions for .NETReactive Extensions for .NET
Reactive Extensions for .NETAndrei Marukovich
 
Deceptive simplicity of async and await
Deceptive simplicity of async and awaitDeceptive simplicity of async and await
Deceptive simplicity of async and awaitAndrei Marukovich
 
All about data persistence in Windows 8
All about data persistence in Windows 8All about data persistence in Windows 8
All about data persistence in Windows 8Andrei Marukovich
 
A Developer's View of Windows 8
A Developer's View of Windows 8A Developer's View of Windows 8
A Developer's View of Windows 8Andrei Marukovich
 

More from Andrei Marukovich (7)

Using NuGet libraries in your application
Using NuGet libraries in your applicationUsing NuGet libraries in your application
Using NuGet libraries in your application
 
Open Source Libraries for.NET developers
Open Source Libraries for.NET developersOpen Source Libraries for.NET developers
Open Source Libraries for.NET developers
 
Reactive Extensions for .NET
Reactive Extensions for .NETReactive Extensions for .NET
Reactive Extensions for .NET
 
Deceptive simplicity of async and await
Deceptive simplicity of async and awaitDeceptive simplicity of async and await
Deceptive simplicity of async and await
 
All about data persistence in Windows 8
All about data persistence in Windows 8All about data persistence in Windows 8
All about data persistence in Windows 8
 
ATDD in practice
ATDD in practiceATDD in practice
ATDD in practice
 
A Developer's View of Windows 8
A Developer's View of Windows 8A Developer's View of Windows 8
A Developer's View of Windows 8
 

Recently uploaded

What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 

Recently uploaded (20)

What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 

C# code sharing across the platforms

  • 1. C# code sharing across the platforms Andrei Marukovich LunarFrog.com twitter: @amarukovich
  • 2. .NET ecosystem .NET Framework .NET Core Xamarin WPF ASP.NET WinForms UWP ASP.NET Core iOS macOS Android
  • 3. Code sharing strategies • Source file links • Shared projects • Portable class libraries (PCLs) • .NET Standard
  • 4. Shared projects • Better version of the source file links UWP project Xamarin project File1.cs File2.cs SharedLib File1.cs File2.cs SharedLib File1.cs File2.cs SharedLibUI App layer UI App layer
  • 6. Shared projects • Benefits • Simple model • May include platform-specific code • Disadvantages • Source-level sharing, no assembly • Compiler directives • Usability
  • 7. Portable class libraries • Sharing code in binary form, without recompiling UWP project Xamarin project File1.cs File2.cs PortableLib UI App layer UI App layer
  • 8. How it works? • PCLs are based on profiles • Profile defines an API surface supported by the library • Profile is identified by combination of supported platforms • http://embed.plnkr.co/03ck2dCtnJogBKHJ9EjY • C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETPortable
  • 10. PCLs
  • 11. Portable class libraries • Benefits • PCLs allow binary distribution • API enforcement • No context switching, simple refactoring • Disadvantages • PCL’s require upfront decision on the supported platforms • Lowest common denominator for the selected platforms • Cannot use compiler directives • Long term maintainability
  • 12. .NET Standard • An evolution of PCLs • .NET Standard defines a set of APIs to be implemented by .NET platforms (specification) • .NET Standard is versioned (API level) • Library developers may choose target .NET Standard version • Version defines API surface, not supported frameworks • The higher the version, the more APIs you have • The lower the version, the more .NET platforms implement it • Analogy: https://gist.github.com/davidfowl/8939f305567e1755412d6dc0b8baf1b7
  • 17. .NET Standard • Current state • Tooling is in preview • Currently PCLs support a wider range of platforms • At the moment, PCL adoption (# of libraries) is higher than .NET Standard • Future • PCL replacement • Standard 2.0 will have significantly larger API surface • Standard 2.0 will be interoperable with .NET Framework