I have an old web service created on ASP.NET (using .asmx) files. I need to use sodium.net - unfortunately, it does not work when loading the dependent libsodium.dll file. Any ideas on what I'm doing wrong?
I added libsodium.net via NuGet.
I renamed the 64-bit DLL to "libsodium.dll" (and other naming conventions too).
I tried to reference libsodium.dll directly, but VS rejects it (not a valid DLL). So I added it as "content" instead of "copy to output".
After creating, I see that the / Bin website folder contains both sodium .dll (.NET assembly) and libsodium.net.
When I try to use libsodium.net, I get:
ERROR 2015-02-02 11:14: 27,118 13798ms [41] CabinetService doRequest - Caught: the type initializer for "sodium sodium" left an exception. System.TypeInitializationException: The type initializer for "Sodium.SodiumCore" made an exception. ---> System.DllNotFoundException: Unable to load DLL 'libsodium.dll': the specified module was not found. (Exception from HRESULT: 0x8007007E) in DynamicDllInvokeType.sodium_init () on sodium. Sodium acid .cctor () --- End of internal check of exception stack --- on sodium .SodiumCore.LibraryName () on Sodium.SecretBox.Create (Byte [ ] message, Byte [] nonce, Byte []) in Macaroons.SecretBoxCryptoAlgorithm.Encrypt (Byte [] key, Byte [] plainText) in c: \ Projects \ Macaroons.Net \ Macaroons.Net \ SecretBoxCryptoAlgorithm.cs: line 58
Thus, he cannot find "libsodium.dll", even if it is located in the bin folder. I also tried to remove the dependency on "sodium .net", where after I got a runtime error saying that there was no "sodium .net" - when I added it again, this error disappeared and instead I got one above (indicating "sodium .net" loads correctly).
So, I open the shadow folder of the website in the folder "C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Temporary ASP.NET Files \ cabinetservice" and look for "sodium". The only result is "sodium .dll" in some subfolder. There is no "libsodium.dll".
So, ASP.NET ignores the file "libsodium.dll" when creating a shadow copy of the website.
I also tried adding libsodium.dll (32 bit) to C: \ Windows \ System32 and libsodium.dll (64 bit) to C: \ Windows \ SysWOW64. The same result.
And I tried C: \ Windows \ Microsoft.NET \ assembly \ GAC_32 \ libsodium and C: \ Windows \ Microsoft.NET \ assembly \ GAC_64 \ libsodium. The same result.
How can I make ASP.NET dependency information?
Jørn wildt
source share