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
Would it be possible to make the System.Runtime.CompilerServices.FriendAccessAllowedAttribute public, to be more explicit and clearly state intent of what exactly should be visible to a friend assembly?
Let me also add that InternalsVisibleToAttribute has a public bool AllInternalsVisible property which is supposed to be used together with FriendAccessAllowedAttribute as mentioned in the summary:
/// If AllInternalsVisible is not true for a friend assembly, the FriendAccessAllowed attribute
/// indicates which internals are shared with that friend assembly.
This comment is left-over from the times when we have experimented with this in .NET Framework. .NET Core does not use it - we did not like the complexity associated with it.
Thanks for the clarification, still it would be nice to have a more explicit and targeted way of making things visible to friend assemblies. This seemed like a possibility, as it is already used on some internal types in mscorlib.
Activity
jkotas commentedon Jul 18, 2018
dotnet/csharplang#1724
This would need to be combined with enforcement in Roslyn or some other tool be actually useful.
lukdr commentedon Jul 18, 2018
Let me also add that InternalsVisibleToAttribute has a
public bool AllInternalsVisibleproperty which is supposed to be used together with FriendAccessAllowedAttribute as mentioned in the summary:This is not possible as the latter is internal.
jkotas commentedon Jul 18, 2018
This comment is left-over from the times when we have experimented with this in .NET Framework. .NET Core does not use it - we did not like the complexity associated with it.
The official documentation just says that this is not implemented.
lukdr commentedon Jul 18, 2018
Thanks for the clarification, still it would be nice to have a more explicit and targeted way of making things visible to friend assemblies. This seemed like a possibility, as it is already used on some internal types in mscorlib.
jkotas commentedon May 24, 2019
This attribute is gone from CoreCLR and mscorlib.
dotnet/csharplang#1724 tracks the language feature that this is really about.