Yubico / Yubico.NET.SDK

A YubiKey SDK for .NET developers
Apache License 2.0
99 stars 47 forks source link

'Unable to load DLL 'Yubico.NativeShims' #12

Closed jzylkin closed 2 years ago

jzylkin commented 2 years ago

I have a very simple example project that has imported the Yubico.Yubikey v1.3.1 NuGet Package. My application does nothing more than run a single line of code:

Dim yubikeys = YubiKeyDevice.FindAll()

However, this code always produces this exception: System.DllNotFoundException: 'Unable to load DLL 'Yubico.NativeShims': The specified module could not be found. (Exception from HRESULT: 0x8007007E)'

Even when I copy the NativeShims DLL to the application directory, I still get this same exception.

NOTE: Because I am also encountering Issue #11 I cannot install the NuGet package directly into my .NET 4.7.2 WinForms project. So, instead, I set up a class library that targets .NET Standard 2.0, and I put my Yubico-related code there. The NuGet installation does not fail, but I continue to get the exception shown above. The nativeshims DLL is not being copied to the application install directory, so I obtained the DLL on my own and I have been copying it there manually. But I still get the exception.

I am running Windows 10, with the Yubikey Manager and Minidriver both installed.

GregDomzalski commented 2 years ago

Hello, thanks for the report. This is still #11. While you were able to work around the NuGet package resolution issue by using the .NETStandard class library, the version of .NET framework is ultimately decided by the application / executable in the project. It's running into the same issue, but in a different way.

I'd ask that we track the resolution of your issue in #11 as well.