Skip to content

Add InternalsVisibleToAttribute and compilation attributes to global attributes reference (Fixes #42831) - #56644

Open
Manish-1kumar wants to merge 2 commits into
dotnet:mainfrom
Manish-1kumar:users/manish/issue-42831-internals-visible-to-attribute
Open

Manish-1kumar wants to merge 2 commits into
dotnet:mainfrom
Manish-1kumar:users/manish/issue-42831-internals-visible-to-attribute

Conversation

@Manish-1kumar

@Manish-1kumar Manish-1kumar commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This pull request addresses #42831 by adding InternalsVisibleToAttribute and related compilation attributes to the assembly-level global attributes documentation.

Changes Made

  • New Category: Added Compilation and assembly access attributes to the global attributes categories and created a dedicated table.
  • InternalsVisibleToAttribute: Documented the attribute that grants friend assemblies access to internal types and members, cross-linking to the Friend assemblies guide.
  • Signing Attributes: Documented AssemblyDelaySignAttribute, AssemblyKeyFileAttribute, and AssemblyKeyNameAttribute with links to Delay-sign an assembly and Strong-named assemblies.
  • Validation: Verified markdownlint with 0 errors.

Fixes #42831


Internal previews

File Preview link
_csharplang/proposals/csharp-14.0/async-main-update.md Learn preview
docs/csharp/language-reference/attributes/global.md Learn preview

Build report

@dotnetrepoman dotnetrepoman Bot added this to the November 2026 milestone Nov 1, 2026
@dotnet-policy-service dotnet-policy-service Bot added dotnet-csharp/svc lang-reference/subsvc community-contribution Indicates PR is created by someone from the .NET community. labels Nov 1, 2026

@BillWagner BillWagner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Manish-1kumar

I like the addition of the InternalsVisibleTo attribute. However, we don't want to promote strong naming in modern .NET applications.

Comment on lines +69 to +71
| <xref:System.Reflection.AssemblyDelaySignAttribute> | Specifies that the assembly is delay-signed when emitted. For more information, see [Delay-sign an assembly](../../../standard/assembly/delay-sign.md). |
| <xref:System.Reflection.AssemblyKeyFileAttribute> | Specifies the name of the file containing the key pair used to generate a strong name. For more information, see [Strong-named assemblies](../../../standard/assembly/strong-named.md). |
| <xref:System.Reflection.AssemblyKeyNameAttribute> | Specifies the name of a key container within the CSP used to generate a strong name. |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These shouldn't be added.

See https://github.com/dotnet/runtime/blob/main/docs/project/strong-name-signing.md for an explanation of why we are no longer recommending strong naming.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Removed the strong-naming attributes and kept InternalsVisibleTo in 18b2853.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After rebasing onto the latest main, that change is now in 42f79d3.

@Manish-1kumar
Manish-1kumar force-pushed the users/manish/issue-42831-internals-visible-to-attribute branch from 18b2853 to e1bf42d Compare November 29, 2026 19:28
…attributes reference

- Add Compilation and assembly access attributes section
- Add InternalsVisibleToAttribute for friend assembly member accessibility
- Add strong-name and delay signing assembly attributes
- Cross-link to friend assemblies and signing guides

Fixes dotnet#42831
@Manish-1kumar
Manish-1kumar force-pushed the users/manish/issue-42831-internals-visible-to-attribute branch from e1bf42d to 42f79d3 Compare November 30, 2026 17:40
@Manish-1kumar

Copy link
Copy Markdown
Contributor Author

@BillWagner I've removed the strong-naming attributes and kept only InternalsVisibleTo (42f79d3). Could you take another look when you have a chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates PR is created by someone from the .NET community. dotnet-csharp/svc lang-reference/subsvc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InternalsVisibleToAttribute missing from "Assembly level attributes interpreted by the C# compiler"

2 participants