-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
See https://github.com/dotnet/corefx/issues/23656, dotnet/corefx#23719 (comment), and dotnet/corefx@75962da.
Whenever we wish to expose portable surface area for a library we must do so through a package. If that library is also inbox in the framework the framework will carry an optimized version of the library that should take precedence.
In all cases the library does not need to follow the netstandard rules (new API can only be in a new NETStandard version), since it is not part of netstandard.
-
In some cases the library can deliver its implementation completely out of band to all frameworks, so the library will want to add new API in a new package and make that API available to all platforms supporting some low version of netstandard say
netstandard1.1. It needs to do this without regressing the inbox implementations on existing frameworks, and also without dropping support for those frameworks or causing missing member/type exceptions or loader exceptions. Examples of this sort of library are System.Collections.Immutable, System.Buffers, and System.Memory. The latter two are interesting in that they are coupled to the NETCore runtime and must preserve that implementation. -
In other cases the library cannot deliver new implementation out of band to some frameworks: for example if the library is exposing types that already exist in desktop and we do not wish to (or cannot) deliver a replacement library out of band. In this case the library cannot add API to existing netstandard versions because those imply a version of desktop which will not have the new API. In these cases we should freeze the API and the assembly version, and ideally not even rebuild the library unless it contains actual code. We should also ensure our build system leads folks into this path so that we don't accidentally break these rules. Examples of this sort of library are Microsoft.CSharp and System.IO.Ports.
We can refer to these two cases as "OOB" libraries and "Anchored" libraries for the purpose of this discussion.