SlideShare a Scribd company logo
.NET Standard
NuGet Analysis
Context
Part 1
.NET API Compatibility
Part 2
P/Invoke Compatibility
Part 1: .NET API Compatibility
• We’ve looked at packages and checked which .NET APIs they are using
• Top 1000
• All
• We’ve broken down the packages into three buckets:
• Packages that target .NET Standard/PCLs
• Packages that only use APIs available in .NET Standard 2.0
• Packages that use APIs unavailable in .NET Standard 2.0
• We’ve grouped the missing APIs by namespace and plotted how
strong a package depends on it
Compatibility of the Top 1000 Packages
63 % are API compatible with .NET Core & Standard 2.0 Still Incompatible
37 %30 % 33 %Top 1000
Provide portable asset Only use available APIs Use unavailable APIs
24 %
Uses app-model specific APIs, such as
• Classic ASP.NET
• WinForms
• WPF
• Xamarin Android & iOS
From those
87 % have also .NET Framework assets
of which
70 % are compatible
with .NET Core & Standard
0 20 40 60 80 100 120 140 160 180 200
(ASP.NET Classic)
(WinForms)
(WPF)
(Xamarin Android)
Microsoft.Win32
System
System.Collections
System.ComponentModel
System.ComponentModel.Composition
System.Data
System.Diagnostics
System.Drawing
System.IdentityModel
System.Net
System.Reflection
System.Runtime
System.Security
System.ServiceModel
<= 1
<= 5
<= 10
<= 20
<= 50
More
Top 1000: Incompatible API Usage
# of missing
APIs
per package
Take Away
 Most packages depend on classic
ASP.NET
 Packages depending on app
models often use 50+ APIs
0 10 20 30 40 50 60
System
System.Runtime
System.Security
System.Reflection
System.Data
System.Diagnostics
System.Drawing
System.ComponentModel.Composition
System.Net
Microsoft.Win32
<= 1
<= 5
<= 10
<= 20
<= 50
More
Top 1000: Incompatible API Usage
Excluding “lost causes”, i.e. only packages with no app model dependencies
Take Away
 Small # app-model agnostic (120)
 Looking at remaining technologies
there seem to be plenty of
packages that only use <= 5 APIs
# of missing
APIs
per package
Compatibility of all packages on NuGet
69 % are API compatible with .NET Core & Standard 2.0 Still Incompatible
32 %12 % 56 %All Packages
Provide portable asset Only use available APIs Use unavailable APIs
37 %30 % 33 %Top 1000 20 %
Uses app-model specific APIs, such as
• Classic ASP.NET
• WinForms
• WPF
• Xamarin Android & iOS
From those
50 % have also .NET Framework assets
of which
88 % are compatible
with .NET Core & Standard
0 1000 2000 3000 4000 5000 6000 7000 8000
(ASP.NET Classic)
(WinForms)
(WPF)
(Xamarin Android)
(Xamarin iOS)
Microsoft.VisualBasic
Microsoft.Win32
System
System.Collections
System.ComponentModel
System.ComponentModel.Composition
System.Data
System.Diagnostics
System.Drawing
System.Management
System.Net
System.Reflection
System.Runtime
System.Security
System.ServiceModel
<= 1
<= 5
<= 10
<= 20
<= 50
More
All Packages: Incompatible API Usage
Take Away
 Most packages depend on classic
ASP.NET
 Packages depending on app
models often use 50+ APIs
# of missing APIs
per package
0 200 400 600 800 1000 1200 1400 1600
Microsoft.Build
Microsoft.VisualBasic
Microsoft.Win32
System
System.Collections
System.ComponentModel
System.ComponentModel.Composition
System.Configuration
System.Data
System.Diagnostics
System.Drawing
System.IO
System.Management
System.Messaging
System.Net
System.Reactive
System.Reflection
System.Runtime
System.Security
System.ServiceModel
<= 1
<= 5
<= 10
<= 20
<= 50
More
All Packages: Incompatible API Usage
Excluding “lost causes”, i.e. only packages with no app model dependencies
# of missing APIs
per package
Take Away
 Relatively small # app-model agnostic
(7000)
 Looking at remaining technologies
there seem to be plenty of packages
that only use <= 5 APIs
Conclusion Part 1: .NET API Compatibility
• 69 % of all available NuGet packages are API compatible with .NET
Standard/.NET Core 2.0
• We shouldn’t prefer .NET Framework assets when compatible assets exists because
in those cases only 70 % are compatible with .NET Standard/Core 2.0
• Where both assets exist, in top 50 non-MSFT packages, the Standard asset uses
~10% fewer API (outliers: in one case 50% less): ie potentially cut-down functionality
• 20 % of all NuGet packages are app-model specific and thus not applicable
• Most depend on classic ASP.NET
• Packages depending on app models often use 50+ APIs
• 11 % of all NuGet packages use missing APIs
• The most used component we don’t have is System.Drawing
• Missing APIs in System.Data are in the process of being addressed
• The rest is distributed across a wide variety of technologies that we already support
in .NET Standard
• Fixing missing APIs in existing tech is hard as they are already maxed out
Part 2: P/Invoke Compatibility
• We’ve looked at packages and checked which P/Invokes are being
declared
• Top 1000
• All
• We’ve broken that down into the same categories as for managed
APIs
• We’ve bucketized the P/Invokes (e.g. Windows, libc etc) and plotted
how strong a package depends on it
P/Invokes in the Top 1000 Packages
37 %30 % 33 %Top 1000
Provide portable asset Only use available APIs Use unavailable APIs
P/Invokes 3 % 4 % 5 %
11 % of the API compatible packages have P/Invokes
P/Invokes in all packages on NuGet
32 %12 % 56 %All Packages
Provide portable asset Only use available APIs Use unavailable APIs
P/Invokes 0.4 % 4 % 4 %
6.5 % of the API compatible packages have P/Invokes
0 10 20 30 40 50 60 70
(ikvm)
(sqlite3)
(Windows)
/usr/lib/libobjc.dylib
/usr/lib/libsystem.dylib
credui
dnsapi
libc
libdl
mpr
powrprof
winmm
<= 1
<= 5
<= 10
<= 20
<= 50
More
Top 1000: P/Invokes in compatible libraries
Take Away
 Most packages with P/Invokes
depend on Win32
 A decent amount of them only use
a few APIs
Excluding “lost causes”, i.e. only packages with no app model dependencies
0 500 1000 1500 2000 2500
(sqlite3)
(Windows)
/usr/lib/libobjc.dylib
credui
Cryptdll
esent
iprop
libc
mpr
mtxex
ntdsapi
rpcrt4
security
Syncfusion.WebKitWrapper
version
winmm
<= 1
<= 5
<= 10
<= 20
<= 50
More
All Packages: P/Invokes in compatible libraries
Take Away
 Most packages with P/Invokes
depend on Win32
 A decent amount of them only use
a few APIs
Excluding “lost causes”, i.e. only packages with no app model dependencies
Conclusion Part 2: P/Invoke Compatibility
• Less than 7% of the packages that are API compatible have P/Invokes
• Most heavily depend on Win32
• Those libraries should work fine on Windows but won’t work as well on Linux
• The P/Invoke analysis does not change the earlier conclusion

More Related Content

PPTX
.NET Standard - Under the Hood
PPTX
.NET Standard - Introduction
PPTX
.Net Standard 2.0
PDF
.Net standard 2.0
PPTX
Microsoft ASP.NET 5 - The new kid on the block
PPTX
Microsoft .Net Technology
PPTX
.NET Framework
PPTX
A Whirldwind Tour of ASP.NET 5
.NET Standard - Under the Hood
.NET Standard - Introduction
.Net Standard 2.0
.Net standard 2.0
Microsoft ASP.NET 5 - The new kid on the block
Microsoft .Net Technology
.NET Framework
A Whirldwind Tour of ASP.NET 5

What's hot (20)

PPTX
Microsoft .Net Framework
PDF
Facilitating Idiomatic Swift with Objective-C
PPTX
Presentation1.pptx
PPTX
Dependency injection
PPTX
How to contribute to an open source project and don’t die during the Code Rev...
PDF
Start with Angular framework
PPTX
ASP.NET 5 - Microsoft's Web development platform reimagined
PDF
Dot Net Core
PDF
Mozilla: Automated Mozmill Tests
PPTX
Uit 2015-cloud-v2
PDF
Alfresco WebScript Connector for Apache ManifoldCF
PPTX
Cypress Testing.pptx
PPTX
DotNet Framework
KEY
Mozmill Crowd
DOCX
PPTX
Enterprise Library 5
PPTX
Introduction to .NET Programming
PDF
Observability beyond logging for Java Microservices
PPTX
Microsoft &lt;3 Linux with ASP.NET Core
PPTX
Validating latest changes with XCI
Microsoft .Net Framework
Facilitating Idiomatic Swift with Objective-C
Presentation1.pptx
Dependency injection
How to contribute to an open source project and don’t die during the Code Rev...
Start with Angular framework
ASP.NET 5 - Microsoft's Web development platform reimagined
Dot Net Core
Mozilla: Automated Mozmill Tests
Uit 2015-cloud-v2
Alfresco WebScript Connector for Apache ManifoldCF
Cypress Testing.pptx
DotNet Framework
Mozmill Crowd
Enterprise Library 5
Introduction to .NET Programming
Observability beyond logging for Java Microservices
Microsoft &lt;3 Linux with ASP.NET Core
Validating latest changes with XCI
Ad

Similar to .NET Standard - NuGet Analysis (20)

PDF
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
PPTX
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
PPTX
.NET MeetUp Amsterdam 2017 - .NET Standard -- Karel Zikmund
PDF
Raffaele Rialdi
PPT
Dotnetintroduce 100324201546-phpapp02
PDF
ITCamp 2017 - Raffaele Rialdi - Adopting .NET Core in Mainstream Projects
PDF
Whats new in .NET for 2019
PDF
Introduction to dot net
PDF
Fasten Industry Meeting with GitHub about Dependancy Management
PDF
DevJam 2019 - Building an ALEC Time Engine
PDF
Effective and Efficient API Misuse Detection via Exception Propagation and Se...
PDF
What's New in AppFuse 2.0
PDF
Lecture11_LaravelGetStarted_SPring2023.pdf
PPTX
Microservices with Azure Service Fabric
PDF
Nike pop up habitat
PDF
AWS CodeCommit, CodeDeploy & CodePipeline
PDF
Kubernetes deep dive - - Huawei 2015-10
PPTX
.net Framework
PPTX
[OPD 2019] AST Platform and the importance of multi-layered application secu...
PPTX
.NET Fundamentals and Business Application Development
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - .NET Standard -- Karel Zikmund
Raffaele Rialdi
Dotnetintroduce 100324201546-phpapp02
ITCamp 2017 - Raffaele Rialdi - Adopting .NET Core in Mainstream Projects
Whats new in .NET for 2019
Introduction to dot net
Fasten Industry Meeting with GitHub about Dependancy Management
DevJam 2019 - Building an ALEC Time Engine
Effective and Efficient API Misuse Detection via Exception Propagation and Se...
What's New in AppFuse 2.0
Lecture11_LaravelGetStarted_SPring2023.pdf
Microservices with Azure Service Fabric
Nike pop up habitat
AWS CodeCommit, CodeDeploy & CodePipeline
Kubernetes deep dive - - Huawei 2015-10
.net Framework
[OPD 2019] AST Platform and the importance of multi-layered application secu...
.NET Fundamentals and Business Application Development
Ad

Recently uploaded (20)

PPTX
Cell Types and Its function , kingdom of life
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Pre independence Education in Inndia.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
RMMM.pdf make it easy to upload and study
PDF
01-Introduction-to-Information-Management.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
Institutional Correction lecture only . . .
Cell Types and Its function , kingdom of life
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Supply Chain Operations Speaking Notes -ICLT Program
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
human mycosis Human fungal infections are called human mycosis..pptx
Pre independence Education in Inndia.pdf
Pharma ospi slides which help in ospi learning
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Final Presentation General Medicine 03-08-2024.pptx
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
102 student loan defaulters named and shamed – Is someone you know on the list?
RMMM.pdf make it easy to upload and study
01-Introduction-to-Information-Management.pdf
Complications of Minimal Access Surgery at WLH
Sports Quiz easy sports quiz sports quiz
Institutional Correction lecture only . . .

.NET Standard - NuGet Analysis

  • 2. Context Part 1 .NET API Compatibility Part 2 P/Invoke Compatibility
  • 3. Part 1: .NET API Compatibility • We’ve looked at packages and checked which .NET APIs they are using • Top 1000 • All • We’ve broken down the packages into three buckets: • Packages that target .NET Standard/PCLs • Packages that only use APIs available in .NET Standard 2.0 • Packages that use APIs unavailable in .NET Standard 2.0 • We’ve grouped the missing APIs by namespace and plotted how strong a package depends on it
  • 4. Compatibility of the Top 1000 Packages 63 % are API compatible with .NET Core & Standard 2.0 Still Incompatible 37 %30 % 33 %Top 1000 Provide portable asset Only use available APIs Use unavailable APIs 24 % Uses app-model specific APIs, such as • Classic ASP.NET • WinForms • WPF • Xamarin Android & iOS From those 87 % have also .NET Framework assets of which 70 % are compatible with .NET Core & Standard
  • 5. 0 20 40 60 80 100 120 140 160 180 200 (ASP.NET Classic) (WinForms) (WPF) (Xamarin Android) Microsoft.Win32 System System.Collections System.ComponentModel System.ComponentModel.Composition System.Data System.Diagnostics System.Drawing System.IdentityModel System.Net System.Reflection System.Runtime System.Security System.ServiceModel <= 1 <= 5 <= 10 <= 20 <= 50 More Top 1000: Incompatible API Usage # of missing APIs per package Take Away  Most packages depend on classic ASP.NET  Packages depending on app models often use 50+ APIs
  • 6. 0 10 20 30 40 50 60 System System.Runtime System.Security System.Reflection System.Data System.Diagnostics System.Drawing System.ComponentModel.Composition System.Net Microsoft.Win32 <= 1 <= 5 <= 10 <= 20 <= 50 More Top 1000: Incompatible API Usage Excluding “lost causes”, i.e. only packages with no app model dependencies Take Away  Small # app-model agnostic (120)  Looking at remaining technologies there seem to be plenty of packages that only use <= 5 APIs # of missing APIs per package
  • 7. Compatibility of all packages on NuGet 69 % are API compatible with .NET Core & Standard 2.0 Still Incompatible 32 %12 % 56 %All Packages Provide portable asset Only use available APIs Use unavailable APIs 37 %30 % 33 %Top 1000 20 % Uses app-model specific APIs, such as • Classic ASP.NET • WinForms • WPF • Xamarin Android & iOS From those 50 % have also .NET Framework assets of which 88 % are compatible with .NET Core & Standard
  • 8. 0 1000 2000 3000 4000 5000 6000 7000 8000 (ASP.NET Classic) (WinForms) (WPF) (Xamarin Android) (Xamarin iOS) Microsoft.VisualBasic Microsoft.Win32 System System.Collections System.ComponentModel System.ComponentModel.Composition System.Data System.Diagnostics System.Drawing System.Management System.Net System.Reflection System.Runtime System.Security System.ServiceModel <= 1 <= 5 <= 10 <= 20 <= 50 More All Packages: Incompatible API Usage Take Away  Most packages depend on classic ASP.NET  Packages depending on app models often use 50+ APIs # of missing APIs per package
  • 9. 0 200 400 600 800 1000 1200 1400 1600 Microsoft.Build Microsoft.VisualBasic Microsoft.Win32 System System.Collections System.ComponentModel System.ComponentModel.Composition System.Configuration System.Data System.Diagnostics System.Drawing System.IO System.Management System.Messaging System.Net System.Reactive System.Reflection System.Runtime System.Security System.ServiceModel <= 1 <= 5 <= 10 <= 20 <= 50 More All Packages: Incompatible API Usage Excluding “lost causes”, i.e. only packages with no app model dependencies # of missing APIs per package Take Away  Relatively small # app-model agnostic (7000)  Looking at remaining technologies there seem to be plenty of packages that only use <= 5 APIs
  • 10. Conclusion Part 1: .NET API Compatibility • 69 % of all available NuGet packages are API compatible with .NET Standard/.NET Core 2.0 • We shouldn’t prefer .NET Framework assets when compatible assets exists because in those cases only 70 % are compatible with .NET Standard/Core 2.0 • Where both assets exist, in top 50 non-MSFT packages, the Standard asset uses ~10% fewer API (outliers: in one case 50% less): ie potentially cut-down functionality • 20 % of all NuGet packages are app-model specific and thus not applicable • Most depend on classic ASP.NET • Packages depending on app models often use 50+ APIs • 11 % of all NuGet packages use missing APIs • The most used component we don’t have is System.Drawing • Missing APIs in System.Data are in the process of being addressed • The rest is distributed across a wide variety of technologies that we already support in .NET Standard • Fixing missing APIs in existing tech is hard as they are already maxed out
  • 11. Part 2: P/Invoke Compatibility • We’ve looked at packages and checked which P/Invokes are being declared • Top 1000 • All • We’ve broken that down into the same categories as for managed APIs • We’ve bucketized the P/Invokes (e.g. Windows, libc etc) and plotted how strong a package depends on it
  • 12. P/Invokes in the Top 1000 Packages 37 %30 % 33 %Top 1000 Provide portable asset Only use available APIs Use unavailable APIs P/Invokes 3 % 4 % 5 % 11 % of the API compatible packages have P/Invokes
  • 13. P/Invokes in all packages on NuGet 32 %12 % 56 %All Packages Provide portable asset Only use available APIs Use unavailable APIs P/Invokes 0.4 % 4 % 4 % 6.5 % of the API compatible packages have P/Invokes
  • 14. 0 10 20 30 40 50 60 70 (ikvm) (sqlite3) (Windows) /usr/lib/libobjc.dylib /usr/lib/libsystem.dylib credui dnsapi libc libdl mpr powrprof winmm <= 1 <= 5 <= 10 <= 20 <= 50 More Top 1000: P/Invokes in compatible libraries Take Away  Most packages with P/Invokes depend on Win32  A decent amount of them only use a few APIs Excluding “lost causes”, i.e. only packages with no app model dependencies
  • 15. 0 500 1000 1500 2000 2500 (sqlite3) (Windows) /usr/lib/libobjc.dylib credui Cryptdll esent iprop libc mpr mtxex ntdsapi rpcrt4 security Syncfusion.WebKitWrapper version winmm <= 1 <= 5 <= 10 <= 20 <= 50 More All Packages: P/Invokes in compatible libraries Take Away  Most packages with P/Invokes depend on Win32  A decent amount of them only use a few APIs Excluding “lost causes”, i.e. only packages with no app model dependencies
  • 16. Conclusion Part 2: P/Invoke Compatibility • Less than 7% of the packages that are API compatible have P/Invokes • Most heavily depend on Win32 • Those libraries should work fine on Windows but won’t work as well on Linux • The P/Invoke analysis does not change the earlier conclusion