tags:

views:

627

answers:

3

I created a WPF project in VS2008 and compiled it with Any CPU, x64 and x86. Any CPU and x64 works, but compiling to x86 the application is hanging when running through VS2008 and crashing when running without debugging. Debugging it with WinDbg I can see a StackOverflowException and sometimes a MissingMethodException relating to WPF methods.

Common sense is telling something here that the CLR is not loading the correct assemblies or something when running 32bit WPF apps. I tried reinstalling .NET Framework 3.5 SP1, but it does not fix the problem. I don't know how to go about checking if the correct assemblies are loaded or used.

Any ideas?

UPDATE: Not a real solution but the best I could do quickly was to reinstall Windows 7

A: 

Try forcing Windows to always use the 32bit CLR and see if it still crashes:

C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64.exe setwow

-Oisin

x0n
Still the same errors, as I can see now it does not matter Any CPU, or x64 setting with that set it will always load 32. So something must be wrong with the 32bit stuff?
adriaanp
+1  A: 

Try to force the right compiler in all projects of your solution :

  1. Properties
  2. Build
  3. Platform target
Guillaume Roy
A: 

I think I ran into this issue also. If I remember correctly, I had a problem where a dependency was compiled for x86 and the main app was compiled for x64, or the other way around. i.e. say I had a library and an app with a main function. I think they both need to compiled the same way. i.e. I don't think you can mix and match. This might not have been the exact same issue. I would go through all the projects in the solution make sure they all have the same settings.

Jon