1

I have had afew people test my application and all of the 32-bit users are telling me it is not working. I am very new to this kind of error so I came here for help. I asked them to copy the Problem Signature of the application Crash and here it is:

Problem signature: Problem Event Name:

CLR20r3 Problem Signature 02: 1.0.0.0

Problem Signature 03: 4d9235a5 Problem

Signature 05: 1.0.0.0 Problem

Signature 06: 4d9235a5 Problem

Signature 07: 33 Problem Signature 08:

22 Problem Signature 09:

System.InvalidOperationException OS

Version: 6.1.7600.2.0.0.256.1 Locale

ID: 4122 Additional Information 1:

0a9e Additional Information 2:

0a9e372d3b4ad19135b953a78882e789

Additional Information 3: 0a9e

Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Community
  • 1
  • 1
Joe
  • 1,047
  • 1
  • 13
  • 25
  • Based on the error I would actually first look to see what version of the .NET Framework you're targeting. Then see what operating systems are being used. It's possible that you're trying to call a .NET API that is not supported on the particular platform. .NET apps should build and run fine under any architecture. Unless you specified x64 as your active solution platform in the Config Mgr. – Paul Sasik Mar 29 '11 at 22:00
  • Could it be the user32.dll I issue in the code? – Joe Mar 29 '11 at 22:05
  • Shouldn't be. That is the correct lib for 32 bit systems. If anything i would expect it to fail the other way around. – Paul Sasik Mar 29 '11 at 22:08
  • I dont have any custom setting that i specified x64 as the only platform, if I did or didn't where can I check on Visual Basic? – Joe Mar 29 '11 at 22:27

2 Answers2

3

I think I post this answer at least once a week. Here we go again: don't guess at this. Write an event handler for the AppDomain.CurrentDomain.UnhandledException event. Log or display the value of e.ExceptionObject.ToString(). You'll have no trouble figuring out why and where your code bombs from that information.

Your declaration for GetAsyncKeyState() is wrong, it returns a Short, not a Keys. But that doesn't explain the exception. You can force your code to run in 32-bit mode as well. Project + Properties, Compile tab, scroll down, Advanced Compile Options. Change Target CPU to "x86".

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
2
  1. In Visual Studio, go to your Project Properties.
  2. Click Compile section.
  3. Click Advanced Compile Options button at the bottom.
  4. Make sure the Target CPU dropdown has 'Any CPU' selected.
  5. Build/Rebuild project/solution.
Code Maverick
  • 20,171
  • 12
  • 62
  • 114
  • Sounds like you have the express Visual Studio edition. Try the method answered [here](http://stackoverflow.com/questions/4104228/change-target-cpu-settings-in-visual-studio-2010-express) by [Cody Gray](http://stackoverflow.com/users/366904/cody-gray). – Code Maverick Mar 29 '11 at 23:59
  • Ive actually Googled it and i had to set advanced settings and exc and it was crazy because I never had this happen to me before so this was my closest answer, i should also note that Cody Gray's comment is correct for what i was using. – Joe Mar 30 '11 at 00:06
  • Ok, great! Glad you got it fixed! – Code Maverick Mar 30 '11 at 00:09