icsharpcode/AvaloniaILSpy

System.BadImageFormatException: Invalid number of sections declared in PE header.

jamescrosswell opened this issue · 2 comments

Steps to reproduce

  1. Create a hello world command line application in dotnet
  2. Publish the application as a single file dotnet publish -c Release -p:PublishSingleFile=true
  3. 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.

image

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).

You mean AvaloniaILSpy? That should be pretty far behind in terms of such functionality.

I see. Is there anything more recent available that will build for MacOS?