-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Obsolete thumbtacked AssemblyName properties #59061
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Would there be some replacement for functionality like: Assembly asm = Assembly.GetAssemblyName(path);
Console.WriteLine(asm.ProcessorArchitecture); Specifically the architecture can be rather useful to get like this. The GetAssemblyName effectively exposes the PE/managed header parser from the runtime to the managed world. The code above does not load the assembly, and it's relatively efficient. Just trying to add context for cases where the obsoleted properties can be useful. |
Use |
Looks good as proposed (though we moved the obsoletions to the properties instead of the accessors public sealed partial class AssemblyName
{
+ [Obsolete("AssemblyName.HashAlgorithm has been deprecated and is not supported.", DiagnosticId = next available)]
public System.Configuration.Assemblies.AssemblyHashAlgorithm HashAlgorithm { get; set; }
+ [Obsolete("AssemblyName.ProcessorArchitecture has been deprecated and is not supported.", DiagnosticId = same as above)]
public System.Reflection.ProcessorArchitecture ProcessorArchitecture { get; set; }
+ [Obsolete("AssemblyName.VersionCompatibility has been deprecated and is not supported.", DiagnosticId = same as above)]
public System.Configuration.Assemblies.AssemblyVersionCompatibility VersionCompatibility { get; set;}
} |
* Obsolete thumbtacked AssemblyName properties Fix #59061 * Ignore obsoletion * Fix pragma * Merge the AssemblyName member obsoletions into a single diagnostic id * Fix pragma to use updated diagnostic id * Suppress SYSLIB0037 in reflection tests * Suppress SYSLIB0037 warnings Co-authored-by: Jeff Handley <[email protected]> Co-authored-by: Jeff Handley <[email protected]>
@jkotas, I had some trouble figuring out how to get architecture out of System.Reflection.Metadata and had trouble finding a relevant example on GitHub. Could you link to somewhere someone did it? Thanks! |
@Forgind We do not respond to comments on old closed PRs and issues. If it is still a problem, open a new discussion or issue |
Background and motivation
AssemblyName has number of properties that are not proper part of assembly name. They do not not roundtrip through AssemblyName string representation and they are ignored by the assembly loader in .NET Core. They should be obsoleted.
API Proposal
API Usage
The text was updated successfully, but these errors were encountered: