-1

My application is VS2012 WPF application. If I turn off "Prefer 32-bit" build, my application will not launch (a window pop up saying error while trying to run.....).

If I want my application to launch, I have to turn on "Prefer 32-bit" option.

My machine is 64-bit Windows 7. I want my application to be 64-bit because I need to load a 64-bit native dll.

What should I do with this case? Why turning off "Prefer 32-bit" build will stop application from launching?

Thanks!

Ono
  • 1,357
  • 3
  • 16
  • 38
  • What is the error in the pop up? – Niall Jun 27 '14 at 20:19
  • error while trying to run "C:\MyApp\MyApp.exe". To me, it looks like it does not really say anything. – Ono Jun 27 '14 at 20:20
  • Similar errors I've seen related to assemblies being loaded that are actually still 32 bit, or vice versa. – Niall Jun 27 '14 at 20:24
  • See if this related question helps http://stackoverflow.com/q/13149905/3747990 – Niall Jun 27 '14 at 20:28
  • I cannot think any 32bit dll gets loaded into my application. – Ono Jun 27 '14 at 20:36
  • It will be a bit of an effort, but `CorFlags` can help double check the assemblies and `Dependency Walker` for any native stuff. – Niall Jun 27 '14 at 20:41
  • If I log off, the first time the application will run. Afterwards it will not. – Ono Jun 27 '14 at 20:45
  • In addition, for the first time the error occur, it actually shows "the network location cannot be reached". Then this information will longer showing afterwards. – Ono Jun 27 '14 at 20:46
  • There seems to be a lot going on in the background here, I'm not sure if I'll be able to help here. – Niall Jun 27 '14 at 20:50
  • No worries, appreciate you are trying. – Ono Jun 27 '14 at 20:52

1 Answers1

0

Use dependency walker. You need to make sure your references are all 32-bit or all 64-bit.

TheBlindSpring
  • 631
  • 5
  • 22