You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Developers can verify their NuGet dependencies compatibility against specific target platform #44920
Cost:XLWork that requires one engineer more than 4 weeksPriority:2Work that is important, but not critical for the releaseTeam:LibrariesUser StoryA single user-facing feature. Can be grouped under an epic.area-Meta
AB#1255325
The Platform Compatibility Analyzer was introduced in .NET 5.0, raising new diagnostics when APIs are referenced that are unsupported on targeted platforms. At present, this analysis can only be performed as part of compilation, providing an experience for identifying unsupported API calls within the IDE or during a build.
The projects which benefit most from the annotations are large scale solutions with many dependencies which are usually not available as a source code implementation. If the same analysis performed by the Platform Compatibility Analyzer could be performed against binaries, we could further improve the impact of this tooling. The analysis could potentially be integrated with the .NET Portability Analyzer as well, helping those seeking to migrate from .NET Framework to identify not only which APIs are and are not available in .NET 5.0+, but which of those APIs were Windows-specific.
changed the title [-]Ability to run the platform compatibility analysis on binaries[/-][+]Developers can verify their app NuGet dependencies compatibility against target platform[/+]on Nov 27, 2020
changed the title [-]Developers can verify their app NuGet dependencies compatibility against target platform[/-][+]Developers can verify their NuGet dependencies compatibility against specific target platform[/+]on Nov 27, 2020
@marek-safar and @bruno-garcia -- Do you have any specific scenarios in mind that can be used as acceptance criteria for this story? At present, this is vaguely defined and low-confidence; specific scenarios would help.
In order to study this further, we need to define some concrete scenarios for usage and expectations.
What would the developer be analyzing?
a. Their source, but analyzing into the NuGet package dependencies they have
b. A DLL
c. A NuGet package
Would this analysis happen inside or outside Visual Studio?
How far into NuGet package dependencies would we traverse for analysis?
What actions would we guide developers to take if a warning is discovered within a referenced assembly/package?
Is the ultimate intent to find netcoreapp APIs that are platform-specific, but used in NuGet packages that are platform agnostic?
@terrajobst@marek-safar -- @buyaa-n and I don't know the answers to these questions. Is the following what you had in mind, or were you thinking of something different?
If we're analyzing the developer's code inside Visual Studio
And the reference an API that comes from a NuGet package and that API does not have any [SupportedOSPlatform]/[UnsupportedOSPlatform] attributes applied
But we're able to inspect the API calls made within the API that is being called (recursively) down to netcoreapp(it is unknown how we could do this)
And we find [SupportedOSPlatform]/[UnsupportedOSPlatform] attributes applied that have not been handled by the intermediate NuGet package's API
Then we provide a warning to the developer that the API they are calling might not be supported on their platforms
There are multiple scenarios you could build on top of the original requirements. However, the core one is very simple.
A developer is building Blazor/Win/Apple/etc. app and adds a dependency to NuGet to help him solve some of his problems. The NuGet is added to the project and builds successfully. The developer keeps working on the code and after few more iterations, the app suddenly throws PNSE. After some time spent the developer finds out that NuGet is targetting net6.0 but it's not compatible with Blazor/Win/Apple target and has to remove the library and rewrite the code written to use a different library or approach.
Cost:XLWork that requires one engineer more than 4 weeksPriority:2Work that is important, but not critical for the releaseTeam:LibrariesUser StoryA single user-facing feature. Can be grouped under an epic.area-Meta
Activity
[-]Ability to run the platform compatibility analysis on binaries[/-][+]Developers can verify their app NuGet dependencies compatibility against target platform[/+][-]Developers can verify their app NuGet dependencies compatibility against target platform[/-][+]Developers can verify their NuGet dependencies compatibility against specific target platform[/+]jeffhandley commentedon Dec 8, 2020
@marek-safar and @bruno-garcia -- Do you have any specific scenarios in mind that can be used as acceptance criteria for this story? At present, this is vaguely defined and low-confidence; specific scenarios would help.
marek-safar commentedon Dec 8, 2020
We have several major scenarios which would benefit from this support greatly and we could come up with more as this can have quite a broad impact.
A few major ones
All of them would benefit from running compact analyzers for all pieces they deploy than for just parts they built from sources.
jeffhandley commentedon Jan 30, 2021
In order to study this further, we need to define some concrete scenarios for usage and expectations.
a. Their source, but analyzing into the NuGet package dependencies they have
b. A DLL
c. A NuGet package
@terrajobst @marek-safar -- @buyaa-n and I don't know the answers to these questions. Is the following what you had in mind, or were you thinking of something different?
[SupportedOSPlatform]/[UnsupportedOSPlatform]attributes appliednetcoreapp(it is unknown how we could do this)[SupportedOSPlatform]/[UnsupportedOSPlatform]attributes applied that have not been handled by the intermediate NuGet package's APImarek-safar commentedon Feb 1, 2021
There are multiple scenarios you could build on top of the original requirements. However, the core one is very simple.
A developer is building Blazor/Win/Apple/etc. app and adds a dependency to NuGet to help him solve some of his problems. The NuGet is added to the project and builds successfully. The developer keeps working on the code and after few more iterations, the app suddenly throws PNSE. After some time spent the developer finds out that NuGet is targetting net6.0 but it's not compatible with Blazor/Win/Apple target and has to remove the library and rewrite the code written to use a different library or approach.
terrajobst commentedon Mar 15, 2021
@cathysull, FYI this is not gonna make the cut for .NET 6.