net standard - under the hood
TRANSCRIPT
.NET StandardUnder the Hood
.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 forwardingAt runtime• Each platform provides an implementation for netstandard.dll
that type forwards to its implementation
How does .NET Standard work?
What can you reference from .NET Standard?
My Standard Library 2.x
.NET Standard Library
.NET Framework Library
Portable Class Library
.NET FRAMEWORK .NET CORE XAMARIN
Via Portability
Via Compatibility Shim
Legend
Application Type
Is able to reference
EXISTING .NET FRAMEWORK CLASS
LIBRARY
.NET Standard under the hood
TYPEFORWARDING
netstandard!ObjectYOUR .NET
STANDARD-BASED CLASS LIBRARY
.NET FRAMEWORK OR PORTABLE
CLASS LIBRARY
NETSTANDARD.DLL
MSCORLIB.DLL
DIFFERENT TYPE
IDENTITIES (BAD)
mscorlib!Object
MSCORLIB.DLLMSCORLIB.DLLFRAMEWORK ASSEMBLIES
This happens when you build a .NET Standard-based Library
.NET Standard under the hood
TYPEFORWARDING
This happens when you load .NET Standard-based library
YOUR .NET APPLICATION
YOUR .NET STANDARD-BASED
CLASS LIBRARYNETSTANDARD.DLL
FRAMEWORK ASSEMBLIES