Download presentation
Presentation is loading. Please wait.
2
Building great libraries using .NET Standard
Aaron Amm Theeranit Senior Software Engineer
3
Covers: Not Covers: What is .NET Standard
How to create .NET Standard class library project Consume your .NET Standard in your .NET Framework project and .NET Standard project .NET Standard work under the hood Type forwarding and netstandard.dll Not Covers: Multiple target .NET Standard class library and platform specific Consume .NET Framework class library and .NET .Core library in your .NET standard library Package Nuget Package
4
What is .NET Standard?
5
What is .NET Standard? .NET Standard is a specification
4/3/2019 5:57 PM What is .NET Standard? .NET Standard is a specification A set of APIs all .NET platforms have to implement .NET Standard .NET Core .NET Framework Xamarin ~ HTML specification (W3C) Browsers (Chrome, Edge) © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
6
.NET Standard in context
.NET FRAMEWORK .NET CORE XAMARIN .NET Standard
7
All the foundational APIs
What’s in .NET Standard? Microsoft.Win32.SafeHandles System.IO.MemoryMappedFiles System.Runtime.Serialization.Formatters.Binary System System.IO.Pipes System.Runtime.Serialization.Json System.CodeDom.Compiler System.Linq System.Runtime.Versioning System.Collections System.Linq.Expressions System.Security System.Collections.Concurrent System.Net System.Security.Authentication System.Collections.Generic System.Net.Cache System.Security.Authentication.ExtendedProtection System.Collections.ObjectModel System.Net.Http System.Security.Claims System.Collections.Specialized System.Net.Http.Headers System.Security.Cryptography System.ComponentModel System.Net.Mail System.Security.Cryptography.X509Certificates System.ComponentModel.Design System.Net.Mime System.Security.Permissions System.ComponentModel.Design.Serialization System.Net.NetworkInformation System.Security.Principal System.Configuration.Assemblies System.Net.Security System.Text System.Data System.Net.Sockets System.Text.RegularExpressions System.Data.Common System.Net.WebSockets System.Threading System.Data.SqlTypes System.Numerics System.Threading.Tasks System.Diagnostics System.Reflection System.Timers System.Diagnostics.CodeAnalysis System.Reflection.Emit System.Transactions System.Diagnostics.Contracts System.Resources System.Windows.Input System.Diagnostics.SymbolStore System.Runtime System.Xml System.Diagnostics.Tracing System.Runtime.CompilerServices System.Xml.Linq System.Drawing System.Runtime.ConstrainedExecution System.Xml.Resolvers System.Dynamic System.Runtime.ExceptionServices System.Xml.Schema System.Globalization System.Runtime.InteropServices System.Xml.Serialization System.IO System.Runtime.InteropServices.ComTypes System.Xml.XPath System.IO.Compression System.Runtime.Serialization System.Xml.Xsl System.IO.IsolatedStorage System.Runtime.Serialization.Formatters All the foundational APIs ~37k APIs in .NET Standard 2.0
8
Versions of .NET Standard
Don’t worry about it. Start with .NET Standard 2.0.
9
.NET Standard is also Open Source!
Next version is planned here:
10
Minimum requirement Visual Studio 2017 .NET Framework 4.7.2
.NET Core 2.1
11
Create a .NET Standard project
13
DEMO CodeSanook.VersionNumberToVersionCode
14
Compile against netstandard.dll
All APIs in netstandard.dll
15
Build output
16
Use your .NET Standard class library
17
DEMO Use your .NET Standard library in your .NET Framework
18
DEMO Use your .NET Standard library in your .NET Core
19
Under the hood
20
.NET Standard under the hood with .NET Framework
4/3/2019 5:57 PM .NET Standard under the hood with .NET Framework YOUR .NET Framework APPLICATION .NET Framework ASSEMBLIES TYPE FORWARDING Common language runtime handle type forwarding YOUR .NET Standard CLASS LIBRARY NETSTANDARD.DLL This happens when you load .NET Standard-based library © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
21
netstandard.dll in .NET Framework
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Facades
22
Launch ILDASM tool C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC>ildasm.exe C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX Tools
24
.NET Standard under the hood with .NET Core
4/3/2019 5:57 PM .NET Standard under the hood with .NET Core YOUR .NET Core APPLICATION .NET Core ASSEMBLIES TYPE FORWARDING Common language runtime handle type forwarding YOUR .NET Standard CLASS LIBRARY NETSTANDARD.DLL This happens when you load .NET Standard-based library © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
25
netstandard.dll in .NET Core
C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.5
27
Q & A http://codesanook.com https://fb.com/codesanookpage
Aaron Amm Theeranit
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.