Different builds of SQLite in the same Windows Store app bundle


  • I'm having a problem deploying an update of my app to the store.

    The app runs SQLite, and I've recently discovered it throws an error on certain x64 architectures.

    BadImageFormatException: An attempt was made to load a program with an incorrect format.

    I understand what this means. The x64 version of the app is using the x86 compiled version of sqlite3.dll. I can get around this issue and build an x64 version by the following method.

    1. Open Project > Properties, and set Platform and Platform Target to x64.
    2. Save
    3. Open Build > Configuration Manager and set Active Platform and Platform (Release) to x64.
    4. Build the project
    5. Open Project > Store > Create App Packages and generate my package

    This creates a correct x64 app package with the x64 version of sqlite3.dll

    Following this for all three architectures (x86, x64 and ARM) gives me three separate appxbundlefiles. When I go to upload a new package to the store through the developer dashboard, I can only upload one of these.

    If I open "Create App Packages" and choose all three architectures for my bundle, it generates a single appxbundle for all three. However when I unzip this appxbundle I can see that the x64 build is using the x86 compiled sqlite3.dll and not the x64 version.

    I tried opening the appxbundle in 7zip and replacing the files, but 7zip could not write to the file, only read it.

    I then tried unzipping the appxbundle and replacing each of the three builds with the correct builds from the singular appxbundles. I then zipped the lot together using no compression and renamed .zip to .appxbundle, but the store rejected this as an invalid file.

    I'm guessing there's some kind of signing going on or a proprietary compression. To be honest I didn't expect that to work but it was worth a try.

    How do I build the correct version of my app for each architecture and include it in a single appxbundle? Can I manually create my own appxbundle from separate builds?

    Wednesday, March 11, 2015 9:49 PM

All replies

  • Hi Roryok,

    In general we can only create one bundle for each app, see this for more information: Create an app package

    If you create an app bundle, you can submit your app to the Store more easily because, no matter how many architectures your app supports, you must upload only one .appxupload file. If you don't create an app bundle, you must upload an .appxupload file for each supported architecture.

    Probably this could help you combine all bundles into one: App packager (MakeAppx.exe)


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, March 12, 2015 2:48 AM
  • If you don't create an app bundle, you must upload an .appxupload file for each supported architecture

    In my experience this doesn't work. Each appxupload file I upload replaces the last. If I upload ARM,X86 and x64 in order, only x64 will remain. 

    Now, it could be just an interface problem and perhaps all three are uploaded, but it definitely appears that only the last appxupload package is used. 

    I've managed to unbundle my combined ARM_x86_x64 bundle file using MakeAppX, replace the appx file for x64 and rebundle again. However I then could not create an appxupload file. MakeAppX does not have this functionality and when I tried using 7zip the resulting archive (renamed to appxupload of course) failed validation. Instead I uploaded my .appxbundle file directly and the store seemed to accept it. Hopefully this will work for me. 

    IF this doesn't work, I believe there is a workaround using multiple projects in the same solution (ie a separate project for x64), but I'd prefer not to go down this route as it would mean fragmenting the code for different architectures and a lot more work to keep everything current. 

    EDIT: The direct upload of an appxbundle file did not work. Validation failed. I've tried the zipping approach again and it seems to have been accepted this time. I'll report back 

    EDIT 2: Multiple projects also doesn't work, they're just treated as separate apps and I can only create an app package from one. 

    • Edited by Roryok Thursday, March 12, 2015 1:31 PM
    Thursday, March 12, 2015 9:56 AM