Description
Repro
-
Create a new C# console project
mkdir C:\work\ilx64
cd C:\work\ilx64
dotnet new console -
Build and run the created project
dotnet run -
Move to the output folder
cd .\bin\Debug\net9.0\ -
Verify that ilx64.dll exists
dir ilx64.dll -
Decompile with ildasm
C:\Users<username>.nuget\packages\runtime.win-x64.microsoft.netcore.ildasm\8.0.0\runtimes\win-x64\native\ildasm.exe /out:ilx64.il .\ilx64.dll -
Run /pe64 with ilasm version 8.0.0 Compile with /x64
C:\Users<username>.nuget\packages\runtime.win-x64.microsoft.netcore.ilasm\8.0.0\runtimes\win-x64\native\ilasm.exe /pe64 /x64 /out:ilx64.dll ilx64.il -
Check operation ※Operates normally
dotnet .\ilx64.dll -
Compile with /pe64 /x64 in version 9.0.0 of ilasm
C:\Users<username>.nuget\packages\runtime.win-x64.microsoft.netcore.ilasm\9.0.0\runtimes\win-x64\native\ilasm.exe /pe64 /x64 /out:ilx64.dll ilx64.il -
Check operation ※BadImageFormatException occurs
dotnet .\ilx64.dll