1

I've got a very strange problem and tried several solutions found in the www, but that not solved my problem.

A few days ago I decided to switch from metafiles to a database, because the metafiles used nearly my complete capacity of my RAM. My choise went to SQLite, because I don't want to force the user to run an entire database server just for running my program.

So I loaded SQLite down to my laptop, referenced it into my project and continued developing. Everything worked fine. Once I arrived home I turned on my desktop-pc and wanted to continue developing (my whole project is always in sync with my dropbox). But as soon as the code reaches the region, where SQLite-calls where made I got an BadImageFormatException.

Google told me to switch my application to x86, but then it crashes...

Both systems are x64 Windows 7.

I moved the dlls to /bin/Debug/lib/x86/ and /bin/Debug/lib/x64/ and edited the .csproj - file like provided in this solution, but that doesn't work at all...

Targeting both 32bit and 64bit with Visual Studio in same solution/project

My .csproj-file now looks like this:

<ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'x86' ">
    <Reference Include="System.Data.SQLite">
          <SpecificVersion>False</SpecificVersion>
          <HintPath>bin\Debug\lib\x86\System.Data.SQLite.dll</HintPath>
    </Reference>
</ItemGroup> 
<ItemGroup Condition=" '$(Platform)' == 'AMD64' ">
    <Reference Include="System.Data.SQLite">
        <SpecificVersion>False</SpecificVersion>
        <HintPath>bin\Debug\lib\x64\System.Data.SQLite.dll</HintPath>
    </Reference>
</ItemGroup>

Thanks in advance

Community
  • 1
  • 1
Cuupa
  • 15
  • 1
  • 5
  • 2
    Have you downloaded the DLLs again? It's not completely impossible that they're corrupt, no? – ta.speot.is Jan 25 '12 at 08:47
  • Sometimes the simplest solution is the best solution... they where indeed corrupt. I downloaded the latest version and now it works.... I feel like a very beginner :D thank you – Cuupa Jan 26 '12 at 10:41

1 Answers1

0

From our discussion in the comments, you are getting a bad image error because the files are corrupt. That is, you're getting a bad image error because you're trying to load bad images.

Cause, meet effect.

ta.speot.is
  • 26,914
  • 8
  • 68
  • 96