Saturday, December 30, 2017

.NET bitness matters when using ODBC drivers

.NET assemblies can be compiled in the AnyCPU configuration, in which they can work on either 32-bit or 64-bit machines but have a preference for one or the other. For most applications, this probably doesn't matter too much. However, it definitely can cause issues if native modules are in play, like ODBC drivers. Some ODBC drivers are only registered for one bitness, so trying to start a connection using one might mysteriously fail on a machine with a different architecture. This caused some trouble for me in a recent deployment.

In these cases, it's probably easiest to compile for only the architecture with known-working ODBC drivers in the deployment environment.

No comments:

Post a Comment