Skip to content

ARM64 on Windows: BadImageFormatException when loading SharpSvn.dll from .NET Framework 4.7.2 application — ARM64 assets only ship under net6.0, no net46/net48 for ARM64 #138

@UtkarshBandekar

Description

@UtkarshBandekar

Summary

On a Windows ARM64 machine, an application targeting .NET Framework 4.7.2 (net472) fails to load SharpSvn.dll with:

Could not load file or assembly 'SharpSvn, Version=1.14005.366.0, Culture=neutral, PublicKeyToken=d729672594885a28' or one of its dependencies.
An attempt was made to load a program with an incorrect format. (BadImageFormatException)

The host process is ARM64, and SharpSvn.dll is also ARM64 (PE Machine: 0xAA64). However, because the ARM64 RID in the NuGet package only provides lib/net6.0 assets (no net46/net48), the net472 CLR cannot load the ARM64 .NET 6 mixed‑mode C++/CLI assembly in‑proc, leading to BadImageFormatException.

x86/x64 work fine using runtimes/win-x86|win-x64/lib/net46, but ARM64 consistently fails for net472.


Environment

  • Application TargetFramework: net472
  • Host OS: Windows 11 ARM64
    • OS: Microsoft Windows 10.0.26200 | OSArch: Arm64
    • Process: 64-bit | ProcArch: Arm64
    • Host EXE machine: ARM64
  • SharpSvn NuGet: SharpSvn 1.14005.366
    • Runtimes present:
      • runtimes\win-x86\lib\net46
      • runtimes\win-x64\lib\net46
      • runtimes\win-arm64\lib\net6.0
      • Missing: runtimes\win-arm64\lib\net46 / net48

What we deployed

  • x86: from runtimes\win-x86\lib\net46 → works
  • x64: from runtimes\win-x64\lib\net46 → works
  • ARM64: from runtimes\win-arm64\lib\net6.0 → fails with BadImageFormatException

ARM64 file list (examples):

Ijwhost.dll
SharpSvn.dll
SharpSvn.xml
SharpPlink-*.svnExe
SharpSvn-DB44-20-*.svnDll

Logs

OS: Microsoft Windows 10.0.26200  | OSArch: Arm64
Process: 64-bit | ProcArch: Arm64
Host EXE machine: ARM64
SharpSvn.dll Machine: 0xAA64
Unhandled exception reading assembly name from '...\arm64\SharpSvn.dll':
Could not load file or assembly 'SharpSvn, Version=1.14005.366.0...'
An attempt was made to load a program with an incorrect format.

Expected behavior

  • Either:
    1. Publish ARM64 assets for .NET Framework (net46/net48) alongside x86/x64, so net472 hosts can load SharpSvn in‑proc on ARM64; or
    2. Document that ARM64 is only supported for .NET 6+, and provide guidance for out‑of‑proc usage from .NET Framework hosts.

Actual behavior

  • ARM64 hosts running net472 cannot load SharpSvn.dll from win-arm64\lib\net6.0; CLR throws BadImageFormatException.

Repro steps

  1. Create a simple net472 app on Windows ARM64.
  2. Reference SharpSvn 1.14005.366.
  3. At runtime, load files from:
    • runtimes\win-x64\lib\net46 → works
    • runtimes\win-arm64\lib\net6.0 → fails with BadImageFormatException.

Analysis

  • SharpSvn embeds native Subversion/APR/OpenSSL payloads and uses C++/CLI IJW with Ijwhost.dll.
  • NuGet selects RID + TFM assets; ARM64 only has net6.0, not net46/net48.
  • A net472 CLR cannot load a mixed-mode .NET 6 assembly.

What would help

  • Add ARM64 assets for .NET Framework (net46/net48).
  • Or document ARM64 as .NET 6-only and provide an official workaround pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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