dotnet / runtime

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

System.Security.AccessControl exposes ObjectSecurity.SecurityDescriptor missing on desktop #30016

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.AccessControl.ObjectSecurity.SecurityDescriptor.get()' 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.

Related: https://github.com/dotnet/corefx/issues/34151 /cc @JeremyKuhne

JeremyKuhne commented 5 years ago

What can we do to address this? I expect the odds of anyone hitting this are very very slim.

ericstj commented 5 years ago

I think the way we normally deal with this is we only expose the API in a TFM where it can be supported. So here that might be exposing in netstandard2.1 or netcoreapp2.0 instead of netstandard2.0.

It wouldn't be the only case where we have API in netstandard2.0 that isn't exposed in desktop (see Crypto, and others, so perhaps you can ignore and just document as a known issue if you don't expect others to hit this and its too hard to fix.