[Breaking change]: *
is no longer accepted as a wildcard attribute value in assembly names
#42598
Open
1 of 3 tasks
Labels
breaking-change
Indicates a .NET Core breaking change
doc-idea
Indicates issues that are suggestions for new topics [org][type][category]
Pri1
High priority, do before Pri2 and Pri3
⌚ Not Triaged
Not triaged
Description
(This breaking is documented retrospectively based on 1P customer feedback.)
Assembly names allowed specifying
*
as a wildcard value for attribute value that was equivalent to not specifying the value at all. This undocumented feature was removed in .NET 7.Version
Other (please put exact version in description textbox)
Previous behavior
*
can be specified as a value for assembly name attribute. For example,Assembly.Load("System.Runtime, Version=*, PublicKeyToken=*")
succeeds. It has identical behavior as not specifying the attribute value at allAssembly.Load("System.Runtime")
.New behavior
Assembly.Load("System.Runtime, Version=*, PublicKeyToken=*")
fails withFileLoadException
with "The given assembly name was invalid." error message.Type of breaking change
Reason for change
This was undocumented feature and it was not consistent implemented by all .NET assembly name parsers. The undocumented feature was removed to unify the behavior of assembly name parsing throughout .NET.
Recommended action
Omit assembly name attributes with wildcard value. For example, change
System.Runtime, Version=*
to justSystem.Runtime
.Feature area
Core .NET libraries
Affected APIs
System.Reflection.Assembly.Load(string assemblyString)
Type.GetType
(all overloads)AssemblyName..ctor(string assemblyName)
The text was updated successfully, but these errors were encountered: