From 99f96157597ead0798b10a0759761f52c3e299ab Mon Sep 17 00:00:00 2001 From: Gleb K <25063330+glebuk@users.noreply.github.com> Date: Tue, 12 Feb 2019 19:20:12 -0800 Subject: [PATCH 1/6] Explain private protected bahavior The behavior of the new in C# 7.2 is ambigious with regards to whether InternalVisibleTo exposes it to friend assemblies or not. It is good to explicitly state that private protected is treated as internal and not as private with regards to cross-assembly visiblity --- .../InternalsVisibleToAttribute.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml b/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml index 64cffdaec0c..bd60ee4c6d7 100644 --- a/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml +++ b/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml @@ -39,7 +39,7 @@ attribute makes them also visible to the types in a specified assembly, which is known as a friend assembly. This only applies to `internal` (`Friend` in VB) methods only, not `private` ones. + Ordinarily, types and members with `internal` or `private protected` scope (in C#) and `Friend` scope (in Visual Basic) are visible only in the assembly in which they are defined. The attribute makes them also visible to the types in a specified assembly, which is known as a friend assembly. This only applies to `internal` (`Friend` in VB) or `private protected` methods only, but not `private` ones. The attribute is applied at the assembly level. This means that it can be included at the beginning of a source code file, or it can be included in the AssemblyInfo file in a Visual Studio project. You can use the attribute to specify a single friend assembly that can access the internal types and members of the current assembly. You can define multiple friend assemblies in two ways. They can appear as individual assembly-level attributes, as the following example illustrates. @@ -155,7 +155,7 @@ constructor defines a friend assembly, which is an assembly that has access to the internal types and members of the current assembly. + The constructor defines a friend assembly, which is an assembly that has access to the internal and private protected types and members of the current assembly. Both the current assembly and the friend assembly must be unsigned, or both must be signed with a strong name. (For more information about strong-named assemblies, see [Creating and Using Strong-Named Assemblies](~/docs/framework/app-domains/create-and-use-strong-named-assemblies.md).) If both are unsigned, the `assemblyName` argument consists of the name of the friend assembly, specified without a directory path or file extension. If both are signed, `assemblyName` consists of the name of the friend assembly without its directory path or file name extension, along with its full public key (but not its public key token). The other components of a strong name, such as those that provide culture, version, or processor architecture information, cannot be specified in the `assemblyName` argument. @@ -293,4 +293,4 @@ - \ No newline at end of file + From 075c9cc4bac4de8cf4a096fcb0f81f0b5d3d651a Mon Sep 17 00:00:00 2001 From: Gleb K <25063330+glebuk@users.noreply.github.com> Date: Tue, 12 Feb 2019 19:25:14 -0800 Subject: [PATCH 2/6] Added notes for VB --- .../InternalsVisibleToAttribute.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml b/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml index bd60ee4c6d7..2d1aaf4e4a4 100644 --- a/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml +++ b/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml @@ -39,7 +39,7 @@ attribute makes them also visible to the types in a specified assembly, which is known as a friend assembly. This only applies to `internal` (`Friend` in VB) or `private protected` methods only, but not `private` ones. + Ordinarily, types and members with `internal` or `private protected` scope (in C#) and `Friend` and `Private Protected` scope (in Visual Basic) are visible only in the assembly in which they are defined. The attribute makes them also visible to the types in a specified assembly, which is known as a friend assembly. This only applies to `internal` (`Friend` in VB) or `private protected`(`Private Protected` in VB) methods only, but not `private` ones. The attribute is applied at the assembly level. This means that it can be included at the beginning of a source code file, or it can be included in the AssemblyInfo file in a Visual Studio project. You can use the attribute to specify a single friend assembly that can access the internal types and members of the current assembly. You can define multiple friend assemblies in two ways. They can appear as individual assembly-level attributes, as the following example illustrates. From 3a4785c6af3f2f21942c24dc95a662a425a47125 Mon Sep 17 00:00:00 2001 From: Gleb K <25063330+glebuk@users.noreply.github.com> Date: Tue, 12 Feb 2019 19:29:52 -0800 Subject: [PATCH 3/6] Update EOL change --- .../InternalsVisibleToAttribute.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml b/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml index 2d1aaf4e4a4..665a05904f7 100644 --- a/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml +++ b/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml @@ -292,5 +292,5 @@ - + From 12c3796be8b607f018bd8d44ee3d341f46b90630 Mon Sep 17 00:00:00 2001 From: Gleb K <25063330+glebuk@users.noreply.github.com> Date: Tue, 12 Feb 2019 19:32:00 -0800 Subject: [PATCH 4/6] Fix end spacing --- .../InternalsVisibleToAttribute.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml b/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml index 665a05904f7..2d1aaf4e4a4 100644 --- a/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml +++ b/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml @@ -292,5 +292,5 @@ - + From d6ccd67712e7d6a7f1044792466491cc8691ae6a Mon Sep 17 00:00:00 2001 From: Gleb K <25063330+glebuk@users.noreply.github.com> Date: Tue, 12 Feb 2019 19:33:25 -0800 Subject: [PATCH 5/6] remove trailing EOL From e105c7c49b46ec98b7e93bd2f4b8d1f3ca3b3a66 Mon Sep 17 00:00:00 2001 From: Gleb K <25063330+glebuk@users.noreply.github.com> Date: Tue, 12 Feb 2019 19:54:38 -0800 Subject: [PATCH 6/6] remove extra aol