Suppose we have an application that is targeted to Any CPU, but this application uses third-party assemblies that have two flavors, a 32-bit and a 64-bit. Which one on them must be used?
If the “Any” option runs an application in both 32 bit and 64 bit, how can I give it two versions of an assembly?
My specific need is a .NET SQLite driver.
Real simple:
If you target your app for “Any CPU”, all things being equal, the app can run on 32- or 64-bit systems.
If your “Any CPU” app has dependencies on 32 or 64 bit dll’s, it will fail if it tries to run on a system that’s missing the dependency.
If you want to “run everywhere”, then your best bet might be to target 32-bit (instead of “Any CPU”). You really don’t need 64-bit unless you have a special requirement for 64 bit.
If you encounter “BadImageExceptions” running your app in 64-bit land, you might wish to consider “Custom Actions”:
http://adamhouldsworth.blogspot.com/2010/10/64bit-custom-actions.html