[NativeAOT] Use AssemblyNameInfo.Name instead of AssemblyNameInfo.FullName#118852
Merged
jkotas merged 1 commit intodotnet:mainfrom Aug 19, 2025
Merged
[NativeAOT] Use AssemblyNameInfo.Name instead of AssemblyNameInfo.FullName#118852jkotas merged 1 commit intodotnet:mainfrom
jkotas merged 1 commit intodotnet:mainfrom
Conversation
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.
Contributor
There was a problem hiding this comment.
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 |
Contributor
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
MichalStrehovsky
approved these changes
Aug 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.