Skip to content

nanoclr is broken on Windows ARM64: x64-only native CLR + x64-only virtualserial installer #1731

@asp2286

Description

@asp2286

Tool

Virtual nanoCLR

Description

The nanoclr global tool has two related issues that block native Windows ARM64 use:

Bug 1 — bundled native CLR is x64-only: nanoclr instance --getversion (and any other CLR-invoking command) fails with 0x8007000B (BadImageFormatException). The bundled nanoFramework.nanoCLR.dll ships only as x64; dumpbin /headers confirms 8664 machine (x64). The package places the native DLL under tools/<tfm>/any/NanoCLR/ rather than the standard runtimes/<rid>/native/ layout, so there's no ARM64 fallback for the loader to pick.

Bug 2 — virtualserial --install downloads the x64 installer on ARM64: the URL is hard-coded to virtual-serial-port-tools-redist.exe, which is x64-only. HHD Software publishes a separate ARM64 build at virtual-serial-port-tools-redist-arm64.exe that should be selected when running on ARM64.

This blocks nanoclr usage entirely on Surface Pro X / 9 / 10, Copilot+ PCs (Snapdragon X), Windows Dev Kit 2023, and Apple Silicon Macs running Windows ARM64.

How to reproduce

On a native Windows ARM64 machine with .NET SDK (arm64) installed:

Bug 1:

  1. dotnet tool install -g nanoclr
  2. nanoclr instance --getversion
  3. CLI banner prints, then fails with 0x8007000B.

Bug 2 (code-level):
The installer URL in VirtualSerialDeviceCommandProcessor.cs is hard-coded to the x64 redist:

string installerName = "virtual-serial-port-tools-redist.exe";

There is no architecture detection, so on Windows ARM64 this would download an x64 binary that won't register. HHD Software publishes an ARM64 build at virtual-serial-port-tools-redist-arm64.exe (verified to exist on hhdsoftware.com).

Expected behaviour

Bug 1 fix: build a native ARM64 nanoFramework.nanoCLR.dll and pack both DLLs using the runtimes convention:
nanoclr.nupkg
└── tools//any/NanoCLR/runtimes/
├── win-x64/native/nanoFramework.nanoCLR.dll
└── win-arm64/native/nanoFramework.nanoCLR.dll
NativeNanoClrLoader already probes runtimes/<rid>/native/ paths — same pattern as nanoframework/nf-interpreter#3313 for macOS / Linux.

Bug 2 fix: select the installer URL based on RuntimeInformation.OSArchitecture:

  • x64 / x86: virtual-serial-port-tools-redist.exe (current default)
  • arm64: virtual-serial-port-tools-redist-arm64.exe (verified to exist on hhdsoftware.com)

Both URLs are publicly hosted by HHD Software.

Screenshots

Image

Aditional context

  • OS: Windows 11 ARM64-based PC
  • .NET SDK: 10.0.203 (arm64), also 9.0.313 installed
  • Default dotnet host: arm64 (C:\Program Files\dotnet\)
  • nanoclr tool version: 1.1.196+4df40db366 (latest from NuGet.org at time of report)
  • Native DLL machine type: x64 (verified via dumpbin /headers)
  • HHD Virtual Serial Port Tools redist URLs verified via HEAD request:
    • x64: https://www.hhdsoftware.com/download/virtual-serial-port-tools-redist.exe → 200 OK
    • arm64: https://www.hhdsoftware.com/download/virtual-serial-port-tools-redist-arm64.exe → 200 OK

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions