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

When i use "dotnet publish" to generate osx-arm64 binary file on my win-x64 pc. I get an incorrect format file. #44359

Open
github0null opened this issue Oct 22, 2024 · 0 comments
Labels
Area-NetSDK untriaged Request triage from a team member

Comments

@github0null
Copy link

Hello, everyone.

I am working on a cross-platform project and distributing binaries to various platforms.

I work on Windows 10 x64, and this is the publish script i'm using:

https://github.com/github0null/eide_tools/blob/master/publish.bat

this is my project:

https://github.com/github0null/eide_tools/blob/master/eide_tools.sln

It will publish osx-arm64 platform dll files by following command:

:: for osx-arm64
echo.
echo --- publish for osx-arm64 ---
echo.
dotnet publish ./eide_tools.sln -o %DIST_DIR%/darwin/unify_builder/arm64^
               -c Release --no-self-contained^
               -r osx-arm64^
               --framework net6.0^
               /property:GenerateFullPaths=true^
               /consoleloggerparameters:NoSummary

But my users tell me that they can't execute that binary on their mac book m1, using dotnet xxx.dll to execute it, and it prompts an error:

Unhandled exception. System.BadImageFormatException: Could not load file or assembly '/Users/zhangqi/.vscode/extensions/cl.eide-3.20.0/res/tools/darwin/unify_builder/arm64/unify_builder.dll'. An attempt was made to load a program with an incorrect format.

In addition, my user told me that if he compile the repository on his mac book and then overwrite the dll files, the program worked without error.

I want to know what I'm missing and what should I do ?

@steveharter steveharter transferred this issue from dotnet/core Oct 22, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NetSDK untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

1 participant