Skip to content

[KNOWN ISSUE] The SDK does not correctly locate the Yubico.NativeShims.dll on 32 bit processes #159

Closed
@DennisDyallo

Description

@DennisDyallo

On .NET Framework The SDK does not correctly locate the Yubico.NativeShims.dll on 32 bit processes.

When loading the SDK and trying to enumerate devices using the FindAll or FindByTransport methods. You will get a System.BadImageFormatException HResult=0x8007000B Message=An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) Source=Yubico.Core

NETFramework apps are 32bit processes by default. The workaround is to set your project to be 64 bit by using <Prefer32Bit>false</Prefer32Bit> in your csproj.

Related issues: #151, #65.

The fix will be published with the next release in December Q4, 2024.
Here's the fix #154

This only affects NET Framework and not NET6 and upwards.

Steps To Reproduce

  1. Start new 4.x project
  2. Import Yubikey nuget package
  3. Attempt to locate Yubikeys
  4. Get System.BadImageFormatException

Version

Affects all versions

Version

Affects all versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    NETFrameworkIssues relating to NET Framework (4.x)bugSomething isn't workingknown issueUsed to indicate known issues by Yubico

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions