2

Recently I got a new PC with Windows 7 and installed C# 2010 Express. I have a LOT of software I wrote on my Vista machine in C# 2008 Express. When I tried to migrate the managed D3D apps to 2010, they all crashed on run with an error "is not a valid Win32 application." and after some troubleshooting I learned it's because MS no longer supports managed DirectX. What a drag. So it looks like I'll have to rewrite a ton of code to use one of the following alternatives:

*XNA
*Direct3D 10/11 API (like you would use in VC++)
*OpenGL
*Some other option, like maybe SlimDX

I'm looking for a solution that is:
*Backwards-compatible (ie, Vista and XP)
*Forwards compatible (I don't want to learn a new system just to have to drop it and learn another one in a year)
*OO-friendly -- I have thousands of lines of code to rewrite. I don't have a problem writing unmanaged code, but a similar OO solution would probably reduce the porting time.

I can't be the first person to run into this issue. What are some solutions other people found?

HypnoToad
  • 585
  • 1
  • 6
  • 18

1 Answers1

1

My guess would be that your applications are built as AnyCPU, referencing x86 assemblies, but your Win7 machine is x64. Building your applications as x86 might solve the issue.

erikkallen
  • 33,800
  • 13
  • 85
  • 120
  • Wow that worked! I tried that before but now I think what happened was one of the DLL's didn't rebuild after I changed it to x86. Well I'm glad that worked but as I'm sure everyone would tell me, I should stop using Managed DirectX. What would be the recommended replacement? – HypnoToad May 10 '12 at 21:10
  • The only thing you need to rebuild as x86 is the exe. I have successfully used SlimDX in the past, and it gets the job done. – erikkallen May 11 '12 at 08:21