Epic: Expand platform compat annotations to cover more configurations #43616
Labels
area-Meta
Epic
Groups multiple user stories. Can be grouped under a theme.
Priority:1
Work that is critical for the release, but we could probably ship without
Team:Libraries
Milestone
In .NET 5 we started with annotations for features and APIs which are not universally available everywhere. We picked Windows and browsers as the initial targets for the experience. To make the experience complete we need to continue annotating remaining platforms we support (e.g. Linux-specific APIs that we expect to add). It goes beyond this as well. It's certainly a "last mile" experience, but for example today you won't get any warnings if you try to use MemoryMappedFile.CreateNew(string, ...) with a non-null string path, even though only a null string path is supported on Linux and macOS. The current platform analyzer doesn't account for such possibilities, with annotations done to just say "if any usage of this API works on a platform, then consider it supported on that platform". We should look at what APIs fall into those partially-supported buckets and consider ways of improving the experience around them. This might be the next issue developers porting to .NET 5 get hung up on from a cross-platform perspective.
We also realized that the platform vertical is not the only limiting factor for APIs availability. There are others based primarily on workload limitations which should offer developers the same experience. We will expand compatibility annotations to cover configurations such as AOT, self-contained bundles and single file.
The projects which benefits most from the annotations are large scale solutions with many dependencies which are usually not available as a source code implementation. Exploring how to run the analysis on the final output would further improve the impact of tooling.
Work Items
Developers can easily resolve Platform Compatibility warnings with a code fixer Developers can follow documentation to resolve Platform Compatibility warnings #44919Developers can verify their app NuGet dependencies compatibility against target platform Developers can verify their NuGet dependencies compatibility against specific target platform #44920Flag platform specific constructor called implicitly in derived types Consider flag platform specific constructor called implicitly in derived types roslyn-analyzers#4404The text was updated successfully, but these errors were encountered: