Create a hello world command line application in dotnet
Publish the application as a single file dotnet publish -c Release -p:PublishSingleFile=true
Try to open the resulting executable in ILSpy... it won't let you (it only let's you open dlls)... but you can rename it to a dll and then open it (or run ilspycmd which let's you specify any file, regardless of the extension)
Error message shown
System.BadImageFormatException: Invalid number of sections declared in PE header.
Details
Tried with ILSpy for macOS arm64
Version ILSpy version 7.2.0.0.rc
ILSpy 7.2.1.6856 on Windows (obtained from the Microsoft Store) can open the same file without issue... It'd be great to know if there's a way to obtain that same version on macOS (I followed the links in the Readme.md file on this site to get the most recent build for Mac OS).
Steps to reproduce
dotnet publish -c Release -p:PublishSingleFile=true
Error message shown
Details