Skip to content

Obsolete thumbtacked AssemblyName properties  #59061

Closed
@jkotas

Description

@jkotas

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

    public sealed partial class AssemblyName
    {
        public System.Configuration.Assemblies.AssemblyHashAlgorithm HashAlgorithm
        {
+           [Obsolete("AssemblyName.HashAlgorithm has been deprecated and is not supported.")]
            get;
+           [Obsolete("AssemblyName.HashAlgorithm has been deprecated and is not supported.")]
            set;
        }
        public System.Reflection.ProcessorArchitecture ProcessorArchitecture
        {
+           [Obsolete("AssemblyName.ProcessorArchitecture has been deprecated and is not supported.")]
            get;
+           [Obsolete("AssemblyName.ProcessorArchitecture has been deprecated and is not supported.")]
            set;
        }
        public System.Configuration.Assemblies.AssemblyVersionCompatibility VersionCompatibility
        {
+           [Obsolete("AssemblyName.VersionCompatibility has been deprecated and is not supported.")]
            get;
+           [Obsolete("AssemblyName.VersionCompatibility has been deprecated and is not supported.")]
            set;
        }
    }

API Usage

var an = new AssemblyName("System.Diagnostics.Process");
an.ProcessorArchitecture = ProcessorArchitecture.IA64; // IA64 is Itanium
Console.WriteLine(an.FullName); // IA64 is not included in the full name
Console.WriteLine(Assembly.Load(an)); // Works fine, requested ProcessorArchitecture is ignored

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions