本文介绍了需要64位的SQLite DLL的托管C#应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图嵌入SQLite的到我的便携式C#.NET 2.0的应用程序,而不是包含在分发文件夹中的DLL文件。然而,嵌入SQLite的,我不能使用由PHXSoftware提供的混合模式库。相反,我使用他们的'只处理的版本。

I'm trying to embed SQLite into my portable C# .NET 2.0 application rather than having the DLL files included in the distribution folder. However, to embed SQLite, I cannot use the Mixed-Mode libraries provided by PHXSoftware. Instead, I am using their 'Managed Only' version.

这工作正常在32位计算机,但是当它在64位机器上运行,它抛出一个格式异常。当我从这里找到了:我需要之前,我使用托管库手动结构要求的格式先加载非托管sqlite3.dll。

This works fine on 32-bit computers, but when it's running on a 64-bit machine, it throws a format exception. As I found out from here: http://sqlite.phxsoftware.com/forums/p/2564/9939.aspx I need to load the unmanaged sqlite3.dll manually in the required architecture format first before I use the managed libraries.

这是在那里我功亏一篑。我找不到SQLite的64位版本与32位单一起包括。任何人都可以帮忙吗?我敢说,没有任何人有任何更好的想法?

That's where I fall short. I cannot find a 64-bit version of SQLite to include along with the 32-bit one. Can anyone help? Dare I say, does anyone have any better ideas?

推荐答案

我建议你自己构建的来源。这是非常直截了当的事情。特别是考虑到sqlite的提供。

I'd recommend you build the source yourself. It's very straight-forward to do. Especially considering Sqlite offers amalgamation source.

以下是编译器的预处理器定义我使用了一个64位版本编译:

Here are the compiler pre-processor defines I use for a 64-bit release build:


  • WIN64 NDEBUG

  • _WINDOWS

  • _USRDLL

  • NO_TCL

  • _CRT_SECURE_NO_DEPRECATE

  • THREADSAFE = 1

  • TEMP_STORE = 1

  • SQLITE_MAX_EXPR_DEPTH = 0

  • WIN64 NDEBUG
  • _WINDOWS
  • _USRDLL
  • NO_TCL
  • _CRT_SECURE_NO_DEPRECATE
  • THREADSAFE=1
  • TEMP_STORE=1
  • SQLITE_MAX_EXPR_DEPTH=0

下面是编译器的预处理器定义我使用了一个32位版本编译:

Here are the compiler pre-processor defines I use for a 32-bit release build:


  • WIN32

  • NDEBUG

  • _WINDOWS

  • _USRDLL

  • NO_TCL

  • _CRT_SECURE_NO_DEPRECATE

  • THREADSAFE = 1

  • TEMP_STORE = 1

  • SQLITE_MAX_EXPR_DEPTH = 0

  • WIN32
  • NDEBUG
  • _WINDOWS
  • _USRDLL
  • NO_TCL
  • _CRT_SECURE_NO_DEPRECATE
  • THREADSAFE=1
  • TEMP_STORE=1
  • SQLITE_MAX_EXPR_DEPTH=0

这篇关于需要64位的SQLite DLL的托管C#应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 12:26