Skip to content

Instantly share code, notes, and snippets.

View weshaggard's full-sized avatar

Wes Haggard weshaggard

  • Microsoft
View GitHub Profile
@weshaggard
weshaggard / reference-assembly-reduction.md
Last active December 15, 2017 00:42
Reduce the number of reference assemblies

For the sake of scoping this document is going to focus on targeting .NET Standard and not .NET Core or .NET Framework, those can be considered more later.

Today if you target .NET Standard 2.0 you will get netstandard.dll which is where all the types are defined but you will also get a ton of facade/shim assemblies that allow folks to consume binaries compiled against other target frameworks. In particular we have a set of shims for .NET Framework (https://github.com/dotnet/standard/blob/master/netstandard/pkg/shims/netfx.shimlist.txt) and a set for older .NET Standard 1.x (https://github.com/dotnet/standard/blob/master/netstandard/pkg/shims/netstandard.shimlist.txt). 112 facades in total. That is a lot of assemblies to be passing around for not a lot of good reasons. Those 112 assemblies only contain the older assembly identity and a set of type-forwards so the types can unify with netstandard.dll. Passing around 112 assemblies as well as reading and parsing them over and over can add a significant amount