View Full Version : Error deploying libsodium

21-Oct-2019, 02:09 AM
We are trying to deploy an application that uses libsodium, but we get an error

Webapp.exe refuses to start because of this error:


The webserver is a Windows 2012, and we have installed the C++ 2017 runtime that came in the libsodium library:


If we try to register libsodium.dll (as admin) we get the following error:


But the api-ms-win-crt-runtime-l1-1-0.dll file is part of windows update KB2999226, that was installed with the
C++ 2017runtime we just installed.

We also tried to reinstall C++ runtine, run repair, and reboot of the webserver withoutluck.

Even tried to install the 64bit C++ runtime also, but still the same error.

Any suggestions?

Vincent Oorsprong
21-Oct-2019, 03:41 AM

If we try to register libsodium.dll (as admin) we get the following error:
Why do you try to use regsvr32? Libsodium is a DLL not a COM module.

21-Oct-2019, 06:30 AM

Why do you try to use regsvr32? Libsodium is a DLL not a COM module.

Out of desperation and lack of knowledge I guess.

21-Oct-2019, 07:10 AM

obviously registering the DLL is not required but of course that also has nothing to do nor does it help with your problem

the error you are getting is that it cannot load the DLL. In most cases this means that either the DLL is not accessible (path or rights) or any of its dependencies is not accessible

i would test with a non webapp test first to take the user rights issue out of the equation (or you can temporarily assign an admin user to your webapp service to see if it is a user rights issue)

23-Oct-2019, 04:10 AM
Thanks for the suggestions, but Im still not having much luck.

I tried to compile a non-webapp program and run it. It fails with this error regardless of I run it as myself or with admin rights:


Then I tried to uninstall the VC redist, and install it as administrator. It installs just fine without errors, but this didn't help either.


Any other suggestions?

23-Oct-2019, 05:46 AM
i think you are missing the VC 2015 redistributable


23-Oct-2019, 07:02 AM
I tried to uninstall 2017 and install 2015, but Im getting an error:

Error 0x80240017: Failed to execute MSU package.

Maybe this 2012 Server is unable to run C++ runtimes newer than 2013?

23-Oct-2019, 09:34 AM
check this maybe


28-Oct-2019, 06:30 AM
Not really any resolution in there. We are able to install the runtime without errors, and we also tried to install KB2999226, but libsodium still can't access the C+ runtime for some strange reason.

4-Nov-2019, 08:06 AM
Never got it to work on the Windows 2012 Server, so we installed a fresh 2016 Server instead, and it worked right out of the box.
Anyway, thanks for the help!

Joseph Mullins
11-Sep-2020, 09:12 PM
Digging up an old thread, but I faced this error last night setting up a development project on a fresh Install of Windows. I had VC++ Redist's installed as recommended (2015, 2017, 2019), also trying the one that came packaged in the security library, but it kept having same error: Unable to load DLL LIBSODIUM.DLL. Dataflex would also crash whenever I would add the library through "Manage Libraries"; giving same event error as OP.

I managed to fix it when I installed VC++ Redist 2008 & 2010. I'm not sure which one triggered the fix, but this is the only google result for such an error, so leaving this here if it helps anyone :D.