dotnet / dotnet/runtime

AssemblyName constructor accepts invalid assembly names such as /hello/world

Open
#123,951 2 comments 0 reactions 0 assignees View on GitHub
area-System.Reflection question
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

### Description

`/hello/world` is not a valid assembly name, but is accepted as one in .NET 10

### Reproduction Steps

```csharp
new AssemblyName("/hello/world")
```

### Expected behavior

System.IO.FileLoadException: The given assembly name was invalid.

### Actual behavior

Returns an instance of `AssemblyName`

### Regression?

In .NET 8 the parser would discard such a name.

### Known Workarounds

_No response_

### Configuration

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.