Skip to content
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

[Breaking change]: * is no longer accepted as a wildcard attribute value in assembly names #42598

Open
1 of 3 tasks
jkotas opened this issue Sep 11, 2024 · 0 comments
Open
1 of 3 tasks
Assignees
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

Comments

@jkotas
Copy link
Member

jkotas commented Sep 11, 2024

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 all Assembly.Load("System.Runtime").

New behavior

Assembly.Load("System.Runtime, Version=*, PublicKeyToken=*") fails with FileLoadException with "The given assembly name was invalid." error message.

Type of breaking change

  • Binary incompatible: Existing binaries might encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code might require source changes to compile successfully.
  • Behavioral change: Existing binaries might behave differently at run time.

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 just System.Runtime.

Feature area

Core .NET libraries

Affected APIs

  • System.Reflection.Assembly.Load(string assemblyString)
  • Type.GetType (all overloads)
  • AssemblyName..ctor(string assemblyName)
@jkotas jkotas added doc-idea Indicates issues that are suggestions for new topics [org][type][category] breaking-change Indicates a .NET Core breaking change Pri1 High priority, do before Pri2 and Pri3 labels Sep 11, 2024
@dotnet-bot dotnet-bot added ⌚ Not Triaged Not triaged labels Sep 11, 2024
@gewarren gewarren removed the ⌚ Not Triaged Not triaged label Sep 11, 2024
@dotnet-bot dotnet-bot added the ⌚ Not Triaged Not triaged label Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
Status: 🔖 Ready
Development

No branches or pull requests

3 participants