Compact Database not working on both x86 and x64-Collection of common programming errors


  • msdn I am creating a WinForms application, and it works fine on x64 platforms. It has a compact database. However when I run it on x86, it fails to load with the following error: “sqlceme35.dll is either not designed to run on Windows or it contains an error”

    The sqlceme35.dll file is the brand new file from the service pack that is supposed to support both platform architectures/os. Is there something I need to do so that it will work on x86?

  • 6 Answers


  • msdn1

  • msdn2

    I’m glad that Eric helped you solving this, but just FYI, compile to x86 doesn’t mean it doesn’t run on x64. I had to change this setting form ‘any cpu’ to x86 on some of our projects so they run on x64, because of some dependencies they have.


  • msdn3 Eric, That article is awesome. Thanks a million for that. Since I am not doing a clickOnce install (which is what I think will provide the x86 version when needed), do I just handle the exception and load the x86 files in the case of non-x64? I may have my users install both runtime MSI files as you say, but was hoping to put all required files on a USB Drive and not have to load anything on the machine. It seems from the article that ClickOnce handles loading the proper files.

    Dave


  • msdn4

    Thanks Alberto, but I need one build that runs on both.


  • msdn5

  • msdn6

    I’m glad that Eric helped you solving this, but just FYI, compile to x86 doesn’t mean it doesn’t run on x64. I had to change this setting form ‘any cpu’ to x86 on some of our projects so they run on x64, because of some dependencies they have.