Wednesday, September 9, 2015

Testing 64-bit Database Driver Applications with Visual Studio

I was recently building an application that was dependent on 64-bit Microsoft Access drivers running in 64-bit IIS and I began running my Unit Tests in Visual Studio.

On my development system I had ONLY installed the 64-bit Microsoft Access drivers and had not installed the corresponding 32-bit drivers.

Therefore, whenever I attempted to run my Unit Tests, my Unit Tests ALWAYS failed because it stated that it could not find the appropriate database drivers on my system!!!

Well, once I remembered that Visual Studio remained a 32-bit process, I attempted to compile and run my Unit Tests as a 64-bit application.

Unfortunately, Unit Tests do not work as a 64-bit application!!

If I attempted to switch to the .NET OLE DB Provider, I got the following error message when running in 64-bit IIS instead: http://weblogs.asp.net/kencox/asp-net-iis-fix-the-microsoft-jet-oledb-4-0-provider-is-not-registered-on-the-local-machine

So the only thing I could do was do all of my testing with 32-bit drivers and then when I deployed to my target system running as a 64-bit process with 64-bit database drivers.

It took me hours upon hours to figure this out, so hopefully if you encounter the same issue with Visual Studio and 64-bit database drivers, now you will know what you have to do!!!

No comments:

Post a Comment