Description
Parsing the type name "System.Int32, , System.Private.CoreLib.dll" fails in the latest .NET 8 builds.
Reproduction Steps
Test code:
var t = Type.GetType ("System.Int32, , System.Private.CoreLib.dll");
Console.WriteLine (t);
Expected behavior
This should be printed:
System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
Actual behavior
An exception:
Unhandled exception. System.IO.FileLoadException: The given assembly name was invalid.
File name: ', System.Private.CoreLib.dll'
at System.Reflection.AssemblyNameParser.ThrowInvalidAssemblyName()
at System.Reflection.AssemblyNameParser.Parse()
at System.Reflection.AssemblyNameParser.Parse(String name)
at System.Reflection.AssemblyName..ctor(String assemblyName)
at System.Reflection.TypeNameParser.ResolveAssembly(String assemblyName)
at System.Reflection.TypeNameParser.GetType(String typeName, ReadOnlySpan`1 nestedTypeNames, String assemblyNameIfAny)
at System.Reflection.TypeNameParser.NamespaceTypeName.ResolveType(TypeNameParser& parser, String containingAssemblyIfAny)
at System.Reflection.TypeNameParser.GetType(String typeName, Func`2 assemblyResolver, Func`4 typeResolver, Assembly requestingAssembly, Boolean throwOnError, Boolean ignoreCase, Boolean extensibleParser)
at System.Type.GetType(String typeName)
Regression?
Yes, the code works fine in .NET 7.
Known Workarounds
No response
Configuration
/Users/rolf/work/maccore/net8.0/xamarin-macios/builds/downloads/dotnet-sdk-8.0.100-preview.4.23178.2/dotnet --info
.NET SDK:
Version: 8.0.100-preview.4.23178.2
Commit: 69e28735b9
Runtime Environment:
OS Name: Mac OS X
OS Version: 13.3
OS Platform: Darwin
RID: osx.13-x64
Base Path: /Users/rolf/work/maccore/net8.0/xamarin-macios/builds/downloads/dotnet-sdk-8.0.100-preview.4.23178.2/sdk/8.0.100-preview.4.23178.2/
.NET workloads installed:
[macos]
Installation Source: SDK 8.0.100-preview.4
Manifest Version: 13.1.8527-ci.darc-net8-0-78d17446-9936-45f9-8740-af082689e6f6/8.0.100-preview.2
Manifest Path: /Users/rolf/work/maccore/net8.0/xamarin-macios/builds/downloads/dotnet-sdk-8.0.100-preview.4.23178.2/sdk-manifests/8.0.100-preview.2/microsoft.net.sdk.macos/WorkloadManifest.json
Install Type: FileBased
[ios]
Installation Source: SDK 8.0.100-preview.4
Manifest Version: 16.2.8527-ci.darc-net8-0-78d17446-9936-45f9-8740-af082689e6f6/8.0.100-preview.2
Manifest Path: /Users/rolf/work/maccore/net8.0/xamarin-macios/builds/downloads/dotnet-sdk-8.0.100-preview.4.23178.2/sdk-manifests/8.0.100-preview.2/microsoft.net.sdk.ios/WorkloadManifest.json
Install Type: FileBased
[maccatalyst]
Installation Source: SDK 8.0.100-preview.4
Manifest Version: 16.2.8527-ci.darc-net8-0-78d17446-9936-45f9-8740-af082689e6f6/8.0.100-preview.2
Manifest Path: /Users/rolf/work/maccore/net8.0/xamarin-macios/builds/downloads/dotnet-sdk-8.0.100-preview.4.23178.2/sdk-manifests/8.0.100-preview.2/microsoft.net.sdk.maccatalyst/WorkloadManifest.json
Install Type: FileBased
[tvos]
Installation Source: SDK 8.0.100-preview.4
Manifest Version: 16.1.9315-ci.darc-net8-0-78d17446-9936-45f9-8740-af082689e6f6/8.0.100-preview.2
Manifest Path: /Users/rolf/work/maccore/net8.0/xamarin-macios/builds/downloads/dotnet-sdk-8.0.100-preview.4.23178.2/sdk-manifests/8.0.100-preview.2/microsoft.net.sdk.tvos/WorkloadManifest.json
Install Type: FileBased
Host:
Version: 8.0.0-preview.4.23176.4
Architecture: x64
Commit: 8d5f520838
.NET SDKs installed:
8.0.100-preview.4.23178.2 [/Users/rolf/work/maccore/net8.0/xamarin-macios/builds/downloads/dotnet-sdk-8.0.100-preview.4.23178.2/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.0-preview.4.23176.6 [/Users/rolf/work/maccore/net8.0/xamarin-macios/builds/downloads/dotnet-sdk-8.0.100-preview.4.23178.2/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.0-preview.4.23176.4 [/Users/rolf/work/maccore/net8.0/xamarin-macios/builds/downloads/dotnet-sdk-8.0.100-preview.4.23178.2/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Other information
It happened somewhere in this range: edb161a...8d5f520
I'm guessing this is the culprit: #83484
CC @jkotas
Description
Parsing the type name
"System.Int32, , System.Private.CoreLib.dll"fails in the latest .NET 8 builds.Reproduction Steps
Test code:
Expected behavior
This should be printed:
Actual behavior
An exception:
Regression?
Yes, the code works fine in .NET 7.
Known Workarounds
No response
Configuration
Other information
It happened somewhere in this range: edb161a...8d5f520
I'm guessing this is the culprit: #83484
CC @jkotas