Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jamescrosswell opened this issue Jun 13, 2023 · 2 comments

Comments

@jamescrosswell
Copy link

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).
@christophwille
Copy link
Member

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

@christophwille christophwille transferred this issue from icsharpcode/ILSpy Jun 13, 2023
@jamescrosswell
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants