-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AssemblyName.FullName
doesn't show PublicKeyToken
portion when the AssemblyName
instance is returned from AssemblyName.GetAssemblyName
#66785
Comments
Tagging subscribers to this area: @dotnet/area-system-reflection Issue DetailsDescriptionFor an assembly that is not strong-named, However, after the assembly is loaded, the Reproduction Steps
Expected behaviorThe Actual behaviorThe Here is what you will see in PowerShell that built with .NET 7-preview.2:
Here is the .NET version:
Regression?Yes. It's a regression to .NET 6 and prior versions. Known WorkaroundsNo response ConfigurationNo response Other informationNo response
|
cc @VSadov |
Likely introduced by the switch to managed implementation. |
This is a matter of visualizing missing PublicKeyToken - whether we write out It looks like 6.0 prints that and we should too, but I wonder if that is always the case or there are other hints to consider on whether to print this or not. |
Interestingly |
Description
For an assembly that is not strong-named,
AssemblyName.FullName
doesn't showPublicKeyToken=null
portion when theAssemblyName
instance is returned fromAssemblyName.GetAssemblyName
. This is a regression from .NET 6.This regression caused one of PowerShell test to fail, which was disabled for the time being:
https://github.com/PowerShell/PowerShell/blob/master/test/xUnit/csharp/test_NativeInterop.cs#L20
However, after the assembly is loaded, the
AssemblyName
instance returned fromAssembly.GetName()
works as expected (and as before).Reproduction Steps
Create a non-strong-named assembly, here is the code for doing that:
Running the above code with .NET 7-preview.2, you will see the
, PublicKeyToken=null
part is missing from theAssembly FullName
.Expected behavior
The
, PublicKeyToken=null
is present, like in .NET 6 and prior .NET versions.Actual behavior
The
, PublicKeyToken=null
portion is missing.Here is what you will see in PowerShell that built with .NET 7-preview.2:
Here is the .NET version:
Regression?
Yes. It's a regression to .NET 6 and prior versions.
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: