ektrah/libsodium-core

Xamarin UWP Support

Closed this issue · 2 comments

Hi - this nuget works perfectly in development but when trying to post to the Microsoft app store their certification check results in the following errors:

Supported APIs
Error Found: The supported APIs test detected the following errors:
API __C_specific_handler in vcruntime140.dll is not supported for this application type. libsodium.dll calls this API.
API __std_type_info_destroy_list in vcruntime140.dll is not supported for this application type. libsodium.dll calls this API.
API memcpy in vcruntime140.dll is not supported for this application type. libsodium.dll calls this API.
API memmove in vcruntime140.dll is not supported for this application type. libsodium.dll calls this API.
API memset in vcruntime140.dll is not supported for this application type. libsodium.dll calls this API.
API strchr in vcruntime140.dll is not supported for this application type. libsodium.dll calls this API.
API strrchr in vcruntime140.dll is not supported for this application type. libsodium.dll calls this API.
Impact if not fixed: Using an API that is not part of the Windows SDK for Microsoft Store apps violates the Microsoft Store certification requirements.

Is this is bug in this nuget or a microsoft issue?

libsodium.dll indeed has a dependency on the Visual C++ Runtime for Desktop applications (vcruntime140.dll).

From here:

There are two versions of each runtime, one for Desktop applications (ex: vcruntime140.dll) and one for UWP applications (ex: vcruntime140_app.dll). Originally, this was due to restrictions and differences between the Desktop and UWP environments, but now most of these restrictions are gone. This used to mean that to run in the store, you must link with the _app versions of the libraries, and depend on the VC++ UWP Framework Package. Nowadays, there is also a Framework Package (UWPDesktop) that contains the non-_app VC++ Libraries that you can depend on in addition to or instead of, assuming your target platform supports the Desktop versions of the runtimes.

The vcruntime140.dll and vcruntime140_1.dll libraries are necessary for a C++ program built with Visual Studio to operate. They contain the implementation of language features for C++ - dynamic type info, exception handling, etc. In practice, vcruntime140_1.dll is just an extension for vcruntime140.dll added afterwards to support a more optimized exception handling implementation.

While having two versions was intentional and required with the original design of the Microsoft Store and UWP, it is a complication we are looking into resolving in the future.

To fix the vcruntime140.dll load issue, [...] add the UWPDesktop Framework Package to your App by right clicking on 'References' under your project > Add Reference. Under 'Universal Windows', you search for 'Visual C++', and the reference 'Visual C++ 2015 UWP Desktop Runtime for native apps' will appear. Select this, and the dependency should be resolved. [...]

Does that help?

I'm closing this issue due to inactivity. Please feel free to re-open.