-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Description
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
**<PublishReadyToRun>true</PublishReadyToRun>**
</PropertyGroup>
</Project>
Console.WriteLine("Hello, World!");
var type = Type.GetType("AotProblem." + "_测试数据记录仪_Iiİı_åäö_Controller_DataLogger1_log_all_", false);
Console.WriteLine(type?.FullName??"null");
var obj = Activator.CreateInstance(type);
Console.WriteLine(obj?.GetType().Name);
Console.ReadLine();
namespace AotProblem
{
public class _测试数据记录仪_Iiİı_åäö_Controller_DataLogger1_log_all_
{
}
}
$ dotnet --list-sdks
5.0.400 [C:\Program Files\dotnet\sdk]
6.0.100-rc.2.21505.57 [C:\Program Files\dotnet\sdk]
$ dotnet --list-runtimes
Microsoft.AspNetCore.All 2.1.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-rc.2.21480.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.29 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-rc.2.21480.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-rc.2.21501.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Found on Windows 10 21H1 19043.1320.
Reproduction Steps
Consider code + csproj above. (dotnet new console with true|false</..> added to it. )
The code below will work when PublishReadyToRun is false, but not when true.
Changing class name to "K" makes it work in all cases however that will not be possible for many customers.
Expected behavior
Code should work regardless of PublishReadyToRun bool value.
Actual behavior
Does work on PublishReadyToRun=false
Does NOT work on PublishReadyToRun=true
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response