Question

I recently moved to windows 8.1 x64 and now I cant debug my old codes from Windows 7 x32 times. Because I am using dll files for x32 OSs. Is there an adapter or something to avoid this handicap?

For example sqlite3 (System.data.SQlite.dll) for x32 can be debugged on x32 but on my computer I can't anymore.

Was it helpful?

Solution

Not sure if this is the case here, but I had a similar problem once where a x86 C# project wouldn't work on x64. The problem was the Any CPU setting.

At first, the Any CPU settings seems like logical case: after all, it's meant to run on both x86 and x64 architectures. The problem is with shared DLLs. If the EXE is compiled in Any CPU mode, and the DLL is compiled in x86 mode.

When you run it on x86 OS, the EXE is executed at x86 mode(that's the only option in this architecture) and the DLL is executed in x86 mode(because it was compiled like that) and everything works.

But when you run it on x64 OS, the EXE is executed at x64 mode - because it's Any CPU so you OS can run it in x64 mode. But the DLL can't be loaded at x64 mode(it doesn't have any) so we get a conflict and it can't be loaded.

Assuming you can't get Any CPU or x64 versions for all your DLLs, the easy solution is to compile the main EXE in x86 mode in order to force x86 emulation on x64 systems.

OTHER TIPS

If you moved to x64 OS, then your .net process may now be choosing to run in x64 mode. If that's the case, then you cannot use 32bit libraries in 64bit process (I'd expect you getting InvalidImageFormatException, but I'm unfamiliar with parse one that you mention). You can see if your process is 32bit or 64bit in Task Manager to confirm if that's the case.

At this point, if confirmed, you have two options:

  • Update your libraries to 64 bit versions. Not all 3rd party libraries necessarily have 64bit versions, but many do.
  • Force your process to run in 32bit mode. Depending on version of VS you have, newer ones in project properties has a setting called something to the tune of "prefer 32bit mode" (don't remember exactly).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top