Skip to content

Extension everything public metadata types break .NET package validation #78416

@stephentoub

Description

@stephentoub

The .NET SDK includes tools that validate public API surface area remains consistent between releases.

Extension everything is generating unspeakable public surface area, and while that surface area is deterministic based on its inputs, it can change based on private details of the source and how it's passed to the compiler.

We need to look into ways the metadata can be made more stable, such that it's robust against things like ordering of how files are passed to the compiler. This, for example, is causing validation errors in dotnet/runtime's attempts to use extension everything in public surface area, because the extension type signatures are added to a ref assembly and separately with implementation to a src assembly, and because of differences outsides of the public surface area, the resulting IL differs between the two in the public APIs that end up getting exposed.

Regardless of whether this can be improved in Roslyn, we should also look into whether the package validation should be taught about unspeakable surface area. Or if we consider such unspeakable (in C#) surface area to still be something that would be a problem if it's not maintained, whether there's any way to avoid those public types in the first place.

cc: @jcouv, @jaredpar, @ericstj

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions