Skip to content

[NativeAOT] Use AssemblyNameInfo.Name instead of AssemblyNameInfo.FullName#118852

Merged
jkotas merged 1 commit intodotnet:mainfrom
jkotas:fullname
Aug 19, 2025
Merged

[NativeAOT] Use AssemblyNameInfo.Name instead of AssemblyNameInfo.FullName#118852
jkotas merged 1 commit intodotnet:mainfrom
jkotas:fullname

Conversation

@jkotas
Copy link
Copy Markdown
Member

@jkotas jkotas commented Aug 18, 2025

AssemblyNameInfo.FullName includes full public key and other details that leads to very long error messages like: `Method will always throw because: Failed to load type 'NonExistent' from assembly 'System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKey=00240000048000009400000006020000002400005253413100040000010001008d56c76f9e8649383049f383c44be0ec204181822a6c31cf5eb7ef486944d032188ea1d3920763712ccb12d75fb77e9811149e6148e5d32fbaab37611c1878ddc19e20ef135d0cb2cff2bfec3d115810c3d9069638fe4be215dbf795861920e5ab6f7db2e2ceef136ac23d5dd2bf031700aec232f6c6b1c785b4305c123b37ab'

Use AssemblyNameInfo.Name instead where possible.

AssemblyNameInfo.FullName

AssemblyNameInfo.FullName includes full public key and other details
that leads to very long error messages like: `Method will always throw because: Failed to load type 'NonExistent' from assembly 'System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKey=00240000048000009400000006020000002400005253413100040000010001008d56c76f9e8649383049f383c44be0ec204181822a6c31cf5eb7ef486944d032188ea1d3920763712ccb12d75fb77e9811149e6148e5d32fbaab37611c1878ddc19e20ef135d0cb2cff2bfec3d115810c3d9069638fe4be215dbf795861920e5ab6f7db2e2ceef136ac23d5dd2bf031700aec232f6c6b1c785b4305c123b37ab'

Use AssemblyNameInfo.Name instead where possible.
Copilot AI review requested due to automatic review settings August 18, 2025 17:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves error message readability in the NativeAOT compiler by replacing AssemblyNameInfo.FullName with AssemblyNameInfo.Name. This change eliminates excessively verbose error messages that include full assembly metadata (version, culture, public key) and instead provides concise assembly names for better user experience.

Key changes:

  • Updates method resolution and debugging output to use simplified assembly names
  • Modifies error message formatting to be more readable
  • Changes the dummy AssemblyNameInfo interface to expose Name instead of FullName

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
ModuleMetadataNode.cs Updates reflectable module name formatting to use short assembly name
Compilation.cs Changes Type.GetType method thunk helper to use simplified assembly name
ThrowHelper.Common.cs Modifies module name resolution for error messages to use short names
AssemblyNameInfo.Dummy.cs Updates dummy interface property from FullName to Name

@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

@jkotas jkotas merged commit f2bfdc1 into dotnet:main Aug 19, 2025
96 of 98 checks passed
@jkotas jkotas deleted the fullname branch August 19, 2025 04:57
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants