Search code examples
mysqluwpwindows-store-apps

Error publishing UWP with Mysql.dll in WINDOWS STORE using Visual Studio


I'm having the following error while posting to the Windows store (microsoft).

API CreateFileW in kernel32.dll is not supported for this application type. MySql.Data.dll calls this API.

API MapViewOfFile in kernel32.dll is not supported for this application type. MySql.Data.dll calls this API.

API OpenFileMappingW in kernel32.dll is not supported for this application type. MySql.Data.dll calls this API.

API AcquireCredentialsHandleW in secur32.dll is not supported for this application type. MySql.Data.dll calls this API.

API CompleteAuthToken in secur32.dll is not supported for this application type. MySql.Data.dll calls this API.

API DeleteSecurityContext in secur32.dll is not supported for this application type. MySql.Data.dll calls this API.

API FreeCredentialsHandle in secur32.dll is not supported for this application type. MySql.Data.dll calls this API.

API InitializeSecurityContextW in secur32.dll is not supported for this application type. MySql.Data.dll calls this API.

API QueryContextAttributesW in secur32.dll is not supported for this application type. MySql.Data.dll calls this API.


Solution

  • The error is pretty self-explanatory - the APIs used by MySQL.Data.Dll are not supported for UWP.

    You have a few options if you want to publish to the Microsoft Store:

    1. If possible, look for a UWP-compatible version of MySQL. Some of those API failures can be trivially replaced with newer API calls, and others probably don't make sense for an app-local database.
      • We are always trying to improve compatibility with existing code, but right now we can't / don't support all these APIs.
    2. If you can't get a UWP-compliant version of MySQL, try another database like SQLite. SQLite is now built-in to Windows and has a UWP-compatible version you can ship in your app if you need to support Windows versions before 14393
    3. If you must use MySQL and can't get a UWP-compliant version, you could try publishing as a Desktop Bridge app
      • This requires special permission though, and right now you can't mix legacy API calls like this and modern XAML UI - they have to be in separate processes.