Reputation: 31
Fellow programmers, if i made a C# app on 64-bit system will i be able to run it without problems on 32-bit system (or 32-bit on 64-bit) ?
Upvotes: 2
Views: 146
Reputation: 1503290
You should probably build the application executable with the CPU type set to 32-bit, and any class libraries set to "Any CPU". Unless you really need the CLR to force 64-bit mode, 32-bit can be more efficient. (This is the default in VS2010, IIRC.)
If you're referencing any native libraries, it can get a little hairier, IIRC - you need to make sure you're using the right version of the library on each architecture. I'm not terribly experienced in that side of things, to be honest. This blog post may help you though.
Upvotes: 4
Reputation: 33272
You should compile it for Any Cpu configuration. With this configuration it works both in 32/64 bit without problem ( if you have com interop or PInvoke inside your code is a longer story )
Upvotes: 3