libsodium-net icon indicating copy to clipboard operation
libsodium-net copied to clipboard

libsodium-64.dll not copied by shadow copying functionnality of NUnit

Open DuAell opened this issue 8 years ago • 6 comments

When using Sodium in NUnit tests, this error message happens :

System.TypeInitializationException : The type initializer for 'Sodium.SodiumCore' threw an exception. ----> System.DllNotFoundException : Unable to load DLL 'libsodium-64.dll': Le module spécifié est introuvable. (Exception from HRESULT: 0x8007007E) at Sodium.SodiumCore.GetRandomBytes(Int32 count) --DllNotFoundException at DynamicDllInvokeType.sodium_init() at Sodium.SodiumCore.Init() at Sodium.SodiumCore..cctor()

It seems it comes from libsodium-64.dll being not copied by NUnit in the newly created test folder.

DuAell avatar May 18 '16 14:05 DuAell

What problem????

sraulm avatar Jul 29 '16 15:07 sraulm

My problem is is the server private the clash royale

sraulm avatar Jul 29 '16 15:07 sraulm

If you're using Resharper and Continuous Testing, read this.

tabrath avatar Oct 31 '16 08:10 tabrath

I got this one as well. First part of the solution was to

  1. create folder called "unmanaged" in your project folder
  2. manually copy libsodium.dll and libsodium-64.dll in it
  3. Add that directory in Global Environment Variable PATH in Global.asax
        protected void Application_Start()
        {
            string path = Environment.GetEnvironmentVariable("PATH");
            string binDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "unmanaged");
            if (path!=null && !path.Contains(binDir))
            {
                Environment.SetEnvironmentVariable("PATH", path + ";" + binDir);
            }

And that did it for my DEV machine...

But, I got the exact same error when deployed to our QA environment. After spending hours messing with permissions, trying to figure out if the dlls are in the right directory, and similar I ran into this post: https://mspcontrol.org/forums/topic/add-user-error-unable-to-load-dll-libsodium-64-dll/#post-4765

You have to install Visual C++ Redistributable for Visual Studio 2015 (13 Mb) https://www.microsoft.com/en-us/download/details.aspx?id=48145

In the end that solved the issue for me.

MuadDib avatar Jul 13 '17 10:07 MuadDib

/xref BurningEnlightenment/libsodium-net#2

BurningEnlightenment avatar Jul 13 '17 14:07 BurningEnlightenment

I no understand, pls you speak spainish

El 13 jul. 2017 12:35 p. m., "Igor Valjevic" [email protected] escribió:

I got this one as well. First part of the solution was to

  1. create folder called "unmanaged"

  2. manually copy libsodium.dll and libsodium-64.dll in it

  3. Add that directory in Global Environment Variable PATH in Global.asax

    protected void Application_Start() { string path = Environment.GetEnvironmentVariable("PATH"); string binDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "unmanaged"); if (path!=null && !path.Contains(binDir)) { Environment.SetEnvironmentVariable("PATH", path + ";" + binDir); }

And that did it for my DEV machine...

But, I got the exact same error when deployed to our QA environment. After spending hours messing with permissions, trying to figure out if the dlls are in the right directory, and similar I ran into this post: https://mspcontrol.org/forums/topic/add-user-error-unable- to-load-dll-libsodium-64-dll/#post-4765

You have to install Visual C++ Redistributable for Visual Studio 2015 (13 Mb) https://www.microsoft.com/en-us/download/details.aspx?id=48145

In the end that solved the issue for me.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/adamcaudill/libsodium-net/issues/136#issuecomment-315040589, or mute the thread https://github.com/notifications/unsubscribe-auth/ATxFOWUWVEHiGbbhP6uRZi_PMlyGv6Hxks5sNfMAgaJpZM4IhXKx .

sraulm avatar Jul 13 '17 14:07 sraulm