简体   繁体   English

.NET申请成64位:ODBC问题

[英].NET application into 64-Bit: ODBC problem

I am currently working on a bigger .NET application provided from a company.我目前正在研究公司提供的更大的 .NET 应用程序。 When handling with a big amount of data there is the problem that the system runs out of memory.当处理大量数据时,系统会出现 memory 耗尽的问题。 After some research I have decided to take the step and change the target platform of the application to 64-Bit.经过一番研究,我决定采取措施将应用程序的目标平台更改为 64 位。 In Visual Studio 2017 there is the possibility to change the platform of the projects... .在 Visual Studio 2017 中,可以更改项目的平台...... When starting to build the application I get the warning CNDL1138 a few times within the output console but the build is successful anyway.开始构建应用程序时,我在 output 控制台中收到了几次警告 CNDL1138,但无论如何构建都是成功的。 When starting the application I get different error/exception messages:启动应用程序时,我收到不同的错误/异常消息:

  • Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll抛出异常:mscorlib.dll 中的“System.IO.FileNotFoundException”
  • Exception thrown: 'System.Data.Odbc.OdbcException' in System.Data.dll抛出异常:System.Data.dll 中的“System.Data.Odbc.OdbcException”
  • Exception thrown: 'System.Data.Odbc.OdbcException' in System.Data.dll抛出异常:System.Data.dll 中的“System.Data.Odbc.OdbcException”
  • Exception thrown: 'System.InvalidOperationException' in System.Windows.Forms.dll抛出异常:System.Windows.Forms.dll 中的“System.InvalidOperationException”

So I started to solve the problems step by step.于是我开始一步步解决问题。 The first thing I tried to solve was the ODCB problem.我试图解决的第一件事是 ODCB 问题。 When starting the problem a pop up window says that there is a mismatch between driver and application.启动问题时,弹出 window 表示驱动程序和应用程序之间存在不匹配。 But I have checked the drivers installed they are 64-Bit like the application.但是我检查了安装的驱动程序,它们是 64 位的,就像应用程序一样。 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#) (补充资料:我正在使用 Visual Studio 2017、.NET Framework 4.6.1,并在 C# 上编程)

As you might know Odbc is a standardized database interface.您可能知道 Odbc 是一个标准化的数据库接口。 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.我知道的一个具体问题是访问 odbc 引擎。 The JET driver used to be common, but it is 32 bit only. JET驱动程序曾经很常见,但它只是 32 位的。 A replacement is the ACE driver , that exists in both x64 and x86 variants.替代品是ACE 驱动程序,它存在于 x64 和 x86 变体中。 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.这需要使用可再发行组件安装在系统上,据我所知,在应用程序中仅包含 dll 文件是不合法的。 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.它也包含在 office 安装中(至少是我当时使用的变体),但是 office 默认使用所有组件的 x86 变体,您需要在安装过程中明确 select x64。

I think you can install the x64 redistributable ace driver side by side of a office x86 installation, but my memory might be faulty.我认为您可以在办公室 x86 安装的同时安装 x64 可再发行 ace 驱动程序,但我的 memory 可能有故障。

I have no idea if there are similar problems with the oracle driver.我不知道 oracle 驱动程序是否存在类似问题。 I would suspect the issue is simpler with the MSSQL driver since 64-bit operation has been standard for a much longer time.我怀疑 MSSQL 驱动程序的问题更简单,因为 64 位操作已成为标准的时间更长。

.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. .Net 将按需解决大多数依赖项,通常这将在编译使用依赖项的第一段代码时完成,即在第一次运行之前完成。 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.检查是什么驱动程序导致您出现问题的一种方法是检查异常发生的位置,即它尝试使用哪种数据库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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