Search code examples
c#mongodbuwpmongodb-.net-driver

Using mongodb driver version 2.14.1 in UWP C# application


I am tring to upgrade mongodb driver used in an UWP C# application (completly writen in C#, build for x86, x64, arm and arm64). The last driver version that worked was 2.10.4. Any driver version above that compiled and was running just fine, but failed WACK ( Windows App Certification Kit). If i upload the updated app package to Windows Store, it fails certification with the same problems as WACK. I need to upgrade the driver because, from februrary 2022, all shared mongodb instances will be upgraded to 5.0. Mongo driver 2.10.4 only supports up to 4.4. The certification problems i am getting are:

Binary analyzer

    Error Found: The binary analyzer test detected the following errors:
        File libzstd.dll has failed the DBCheck check.
    Impact if not fixed: If the app doesn’t use the available Windows protections, it can increase the vulnerability of the customer's computer to malware.
    How to fix: Apply the required linker options - SAFESEH, DYNAMICBASE, NXCOMPAT, and APPCONTAINER - when you link the app.

Supported APIs

    Error Found: The supported APIs test detected the following errors:
        API MessageBoxW in user32.dll is not supported for this application type. libzstd.dll calls this API.
        API ___lc_codepage_func in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API __dllonexit in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API __iob_func in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API __mb_cur_max in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API _amsg_exit in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API _errno in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API _exit in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API _initterm in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API _lock in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API _onexit in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API _snwprintf in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API _unlock in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API abort in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API calloc in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API clock in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API fflush in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API fputc in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API free in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API fwprintf in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API fwrite in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API getenv in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API localeconv in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API malloc in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API memcmp in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API memcpy in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API memmove in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API memset in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API qsort in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API raise in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API signal in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API strerror in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API strlen in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API strncmp in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API vfprintf in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API wcscpy in msvcrt.dll is not supported for this application type. libzstd.dll calls this API.
        API wcslen in msvcrt.dll is not supported for this application type. libzstd.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.
    How to fix: Review the error messages to identify the API that is not part of the Windows SDK for Microsoft Store apps. Please note, apps that are built in a debug configuration or without .NET Native enabled (where applicable) can fail this test as these environments may pull in unsupported APIs. Retest your app in a release configuration, and with .NET Native enabled if applicable. 

Platform appropriate files

    Error Found: The platform appropriate files test detected the following errors:
        File libzstd.dll is designed only for x64 processor type; App package manifest declares 'ProcessorArchitecture' as arm.
        File mongocrypt.dll is designed only for x64 processor type; App package manifest declares 'ProcessorArchitecture' as arm.
        File snappy32.dll is designed only for x86 processor type; App package manifest declares 'ProcessorArchitecture' as arm.
        File snappy64.dll is designed only for x64 processor type; App package manifest declares 'ProcessorArchitecture' as arm.
    Impact if not fixed: Including files in the app package that are incompatible with the target processor architecture may cause your app to fail at runtime.
    How to fix: Ensure that binary file architecture is compatible with the ProcessorArchitecture attribute specified within the app package manifest. 

Any help is appreciated


Solution

  • Maybe you can remove the need to have a driver. If you only need a simple GET/PUT you can make a http request.