Skip to content

AOT publish with /p:AssemblyName does not produce working binary #48519

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

Open
mcraiha opened this issue Apr 16, 2025 · 0 comments
Open

AOT publish with /p:AssemblyName does not produce working binary #48519

mcraiha opened this issue Apr 16, 2025 · 0 comments
Labels
Area-NetSDK untriaged Request triage from a team member

Comments

@mcraiha
Copy link

mcraiha commented Apr 16, 2025

Describe the bug

If I publish AOT binary with /p:AssemblyName parameter then I get Unhandled exception. System.TypeLoadException: Could not load type kind of error when executing the binary

I am trying to set final output binary name with /p:AssemblyName parameter. If I leave /p:AssemblyName out then the binary works (but binary file name is clitool).

To Reproduce

You can clone https://github.com/mcraiha/CSharp-AUDALF and move to clitool folder and execute
dotnet publish -o out --configuration Release -r linux-x64 /p:AssemblyName=audalf-cli
and then try to execute the binary with
./audalf-cli

Exceptions (if any)

Unhandled exception. System.TypeLoadException: Could not load type 'CSharp_AUDALF.AUDALF_Deserialize' from assembly 'audalf-cli, Version=1.0.0.0, Culture=neutral, PublicKey=null'.
at AudalfCli.Program.Main(String[] args) + 0x16
Aborted (core dumped)

Further technical details

I only tested this with Ubuntu 24.04 + .NET 9

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Apr 16, 2025
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