libsodium-net
libsodium-net copied to clipboard
.NET 4.6.1 Class lib using libsodium-net 0.9.0 keeps getting DllNotFound exception
Environment: Windows 10 Pro, 64 bit Visual Studio 2015 Enterprise Project references NuGet v 0.9.0
Symptom: When running, as soon as the code calls into Sodium e.g. PasswordHash.ScryptHashString, I get a DllNotFoundException even though libsodium.dll and libsodium-x64.dll are both in the bin
The only way I can get the code to run is to copy libsodium-x64.dll to System32 folder.
same issue
I have the same issue.
I initially got around it by adding the directory containing the libraries to the PATH, as given in the answer here:
http://stackoverflow.com/questions/28275944/how-to-include-libsodium-net-on-asp-net
...but while that worked on my machine, upon deploying everything to a separate test server it stopped working again, despite confirming that the directory was still correct on the test server -- which seems to be echoed by Gram's comment on that accepted answer.
EDIT: I should also mention that this is happening with both 0.9.0 and the latest 0.10.0-beta3 pre-release version off of nuget.
EDIT 2: I've fixed my problem -- it turns out that what was actually missing were the Visual C++ run-time components! Downloading one of the packages at https://support.microsoft.com/en-us/kb/2977003 fixed the issue. Talk about a misleading error!
Got the same issue. Installing the newest Visual C++ run-time components did not help me.
I had the same problem in my application, all of my users running 64bit machines were being affected Turns out, the only thing I had to do was untick the "Prefer 32 bit" checkbox under the Build tab of my project's properties It's on by default using .NET 4.5 and above, and it forces your application to have a 32bit process, even on a 64bit machine
This has fixed the issue (in addition to having the 2015 visual c++ redistributable installed)