vcpkg icon indicating copy to clipboard operation
vcpkg copied to clipboard

Tutorial instructions wrong for setting up binary cache using NuGet on Linux aarch64

Open MarkCallow opened this issue 6 months ago • 0 comments

Describe the bug The tutorials at https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-nuget?pivots=shell-bash and https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-packages?pivots=linux-runner tell you to do, (paraphrasing here)

mono `vcpkg fetch nuget` <args>

When running on Ubuntu/arm64 (a.k.a. aarch64) following these instructions you will get the error

Cannot open assembly '/usr/bin/nuget': File does not contain a valid CIL image.

Environment

  • OS: Ubuntu
  • Compiler: n/r

To Reproduce Steps to reproduce the behavior:

  1. On Ubuntu / arm64 follow the instructions given in https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-packages?pivots=linux-runner for adding packages as a NuGet source.
  2. See error

Expected behavior I expected it to set up the NuGet source.

Failure logs "Cannot open assembly '/usr/bin/nuget': File does not contain a valid CIL image."

Additional context The problem is because the nuget.exe downloaded in the arm64 case is a shell script

#!/bin/sh
exec /usr/bin/cli /usr/lib/nuget/nuget.exe "$@"

Adding sources will work if you drop the mono and just do

`vcpkg fetch nuget` <args>

At a minimum the tutorial needs to be fixed to show the different commands needed.

However I think a preferable fix is to change the x64_64 implementation to return a similar shell script then all cases can be handled without explicitly calling mono.

MarkCallow avatar Jun 13 '25 02:06 MarkCallow