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
API proposal: obsolete DisablePrivateReflectionAttribute #43247
Per #11811, the runtime does not honor DisablePrivateReflectionAttribute, and there are no plans to restore this capability. We should obsolete the API.
namespaceSystem.Runtime.CompilerServices{[Obsolete("DisablePrivateReflectionAttribute has no effect in .NET Core and .NET 5.0+ applications.")]// NEW attribute[AttributeUsage(AttributeTargets.Assembly,AllowMultiple=false,Inherited=false)]publicsealedclassDisablePrivateReflectionAttribute:Attribute{publicDisablePrivateReflectionAttribute(){}}}
I recommend using a normal [Obsolete] attribute with no diagnostic id since there's no real required reading here, nor should people really be suppressing this. They should just remove the attribute. There is no replacement mechanism to restore this functionality.
If we really wanted a diagnostic id and the whole breaking change rigamarole that it entails, we could use SYSLIB0013. I'll file a separate doc issue regardless of whether we use a unique diagnostic id here.
We should use a diagnostic ID. This allows us to have a help-topic specific for this issue. SYSLIB0013 sounds yes. The topic seems to warrant that.
Other than that, looks good.
namespaceSystem.Runtime.CompilerServices{[Obsolete("DisablePrivateReflectionAttribute has no effect in .NET Core and .NET 5.0+ applications.")]publicpartialclassDisablePrivateReflectionAttribute{}}
Activity
terrajobst commentedon Oct 20, 2020
Video
SYSLIB0013sounds yes. The topic seems to warrant that.