-
Notifications
You must be signed in to change notification settings - Fork 60
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Hi!
We recently had a bug report from a user, who got the following stack trace:
System.DllNotFoundException: Dll was not found.
at Yubico.PlatformInterop.NativeMethods.SCardEstablishContext(SCARD_SCOPE, SCardContext& )
at Yubico.Core.Devices.SmartCard.DesktopSmartCardDeviceListener..ctor()
at Yubico.Core.Devices.SmartCard.SmartCardDeviceListener.Create()
at Yubico.YubiKey.YubiKeyDeviceListener..ctor()
at Yubico.YubiKey.YubiKeyDeviceListener.get_Instance()
This took quite a bit of research, but we figured out that the cause was that the system was missing the Visual C++ Redistributable. The error message is less than informative...
This is on Windows 11 Home. The user has a brand new Dell Optiplex 7020 Micro Form Factor, and apparently they do not pre-install an appropriate Visual C++ Redistributable.
The problem was worked around by having the user install the latest supported redistributable from https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist.
However, as I understand it, it should be possible to build the native shims and link entirely statically.
The size increase should be quite modest, and it's a large burden to require the user to ensure the installation of the redistributable. Especially if the app is a plain single file executable and does not have an installer of it's own.
Also, as I understand it, it is not allowed to redistribute the actual dll's - only the redistributable installer.
Everything would be so much more solid and reliable if the native shims do not require the installation of the redistributable.
Expected Behavior
I would expect that this would never happen, that as long as I have the Yubico dll's they are entirely self-contained and only use features that are guaranteed to exist on the target system.
Steps To Reproduce
To reproduce, try to access anything that goes through the native shims on a system without the redistributable installed.
Version
1.14.1
Version
N/A
Anything else?
I checked and could not find an issue with this, and our current release is one or two releases behind the current SDK. If this is fixed in the current SDK version, that is of course awesome, please comment on this and let me know.
I classify it as a bug, especially as I can find no documentation stating that the redistributable is required, and that it is the consumer of the SDK's responsibility to ensure this. As mentioned, pushing the responsibility to the SDK consumer is not a good idea I think.