简体   繁体   中英

.NET application into 64-Bit: ODBC problem

I am currently working on a bigger .NET application provided from a company. When handling with a big amount of data there is the problem that the system runs out of memory. After some research I have decided to take the step and change the target platform of the application to 64-Bit. In Visual Studio 2017 there is the possibility to change the platform of the projects... . When starting to build the application I get the warning CNDL1138 a few times within the output console but the build is successful anyway. When starting the application I get different error/exception messages:

  • Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll
  • Exception thrown: 'System.Data.Odbc.OdbcException' in System.Data.dll
  • Exception thrown: 'System.Data.Odbc.OdbcException' in System.Data.dll
  • Exception thrown: 'System.InvalidOperationException' in System.Windows.Forms.dll

So I started to solve the problems step by step. The first thing I tried to solve was the ODCB problem. When starting the problem a pop up window says that there is a mismatch between driver and application. But I have checked the drivers installed they are 64-Bit like the application. I have no clue what the problem could be with the drivers.

So is here anyone with the same problem and could solve it?

(Addition information: I am using Visual Studio 2017, .NET Framework 4.6.1, and programming on C#)

As you might know Odbc is a standardized database interface. For it to work it needs a driver specific to the actual database engine.

A specific problem I know about is the access odbc engine. The JET driver used to be common, but it is 32 bit only. A replacement is the ACE driver , that exists in both x64 and x86 variants. This needs to be installed on the system using the redistributable, as far as I know there is no legal way to just include the dll files in the application. It is also included in office installations ( at least the variant I used at the time ), but office uses x86 variants of all components by default, you need to explicitly select x64 during installation.

I think you can install the x64 redistributable ace driver side by side of a office x86 installation, but my memory might be faulty.

I have no idea if there are similar problems with the oracle driver. I would suspect the issue is simpler with the MSSQL driver since 64-bit operation has been standard for a much longer time.

.Net will resolve most dependencies on demand, typically this would be done when the first piece of code that uses the dependency is compiled, ie before the first time it is run. A way to check what driver is causing you issues would be to check where the exception occurs, ie what kind of database did it try to use.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM