dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.15k stars 4.71k forks source link

System.Security.Permissions exposes types absent from desktop #30019

Open ericstj opened 5 years ago

ericstj commented 5 years ago

Run API compat between netstandard2.0 reference and net461 and observe the following:

MembersMustExist : Member 'System.Security.Permissions.KeyContainerPermissionAccessEntryCollection..ctor()' does not exist in the this-assembly but it does exist in the compatible-assembly.
MembersMustExist : Member 'System.Security.Permissions.KeyContainerPermissionAccessEntryCollection.CopyTo(System.Array, System.Int32)' does not exist in the this-assembly but it does exist in the compatible-assembly.
MembersMustExist : Member 'System.Security.Permissions.KeyContainerPermissionAccessEntryEnumerator..ctor()' does not exist in the this-assembly but it does exist in the compatible-assembly.

This means someone writing an assembly which depends on this APIs will fail with a MissingMethodException when run on desktop.

Introduced https://github.com/dotnet/corefx/pull/17677 /cc @ViktorHofer

ViktorHofer commented 5 years ago

omg, that's a bug introduced by me but those APIs already shipped. @ericstj what do you recommend to do about it at this point?

ericstj commented 5 years ago

If we can't fix it without breaking something that's already shipped, then document the broken API. It may make sense to chat with @terrajobst to see if we need to account for these land-mines in the analyzer that helps folks be aware of platform differences.

terrajobst commented 5 years ago

Damn that sucks :-(

@ViktorHofer would you mind submitting a PR that adds them to this file?