1

I have created a WPF Windows Application project based on the existing standards in the solution. The project properties had Platform Target as Any CPU and says Prefer 32-bit. Mine is a 64-bit machine and the application wasn't launching, it took me while to figure out and turned off Prefer 32-bit to launch it.

My question is what is happening when I say Prefer 32-bit? I expect it to launch it as a 32 bit application on a 64-bit machine. But in my case it does not run, it simply terminates. Why?

Edit:

The problem was when I say Prefer 32-bit or x86 it builds the application in 32-bit mode. Any CPU makes it a 64-bit build. The application launches only in 64-bit mode and when launched with 32-bit mode it terminates without any exception.

Carbine
  • 7,849
  • 4
  • 30
  • 54
  • http://stackoverflow.com/questions/12066638/what-is-the-purpose-of-the-prefer-32-bit-setting-in-visual-studio-2012-and-how – yakiro Sep 24 '13 at 06:34
  • Can you explain in more details the phrase `and the application wasn't launching`. – Hamlet Hakobyan Sep 24 '13 at 06:34
  • @yakiro Thanks for the reference to the link, Based on the explanation I expect the application to launch even on a 64-bit machine as a 32 bit application. The link doesn't explain on why it will not launch. – Carbine Sep 24 '13 at 06:49
  • http://blogs.microsoft.co.il/blogs/sasha/archive/2012/04/04/what-anycpu-really-means-as-of-net-4-5-and-visual-studio-11.aspx – Vikram Bose Sep 24 '13 at 06:54
  • @Bharath so what you're asking is why you application crashed right? have you checked the Application log (in the event viewer) for some hints? – yakiro Sep 24 '13 at 08:39
  • Thanks for the suggestion @yakiro it didnt give me much info – Carbine Sep 25 '13 at 08:26

1 Answers1

1

After trial and error found out that problem is with the length of the AssemblyName. It was 56 character long after I reduced it to say 36 character it worked fine. Could not get information on whats the permissible limit for 32-bit assembly name and 64-bit assembly name. But 64 bit allows bigger names which has caused the confusion.

Carbine
  • 7,849
  • 4
  • 30
  • 54