[英]Visual Studio VSTO 32-bit and 64-bit builds
I am writing an Outlook VSTO addin using Visual Studio.我正在使用 Visual Studio 编写 Outlook VSTO 插件。 The addin uses SQLite.
插件使用 SQLite。 It needs a dll called SQLite.interop.dll.
它需要一个名为 SQLite.interop.dll 的 dll。 This comes in a 32-bit version and 64-bit version, and Outlook wants the correct version.
这有 32 位版本和 64 位版本,Outlook 需要正确的版本。 If the end user is running a 32-bit version of Office on a 64-bit CPU, Outlook needs the 32-bit version of the dll, and the 64-bit version doesn't work.
如果最终用户在 64 位 CPU 上运行 32 位版本的 Office,则 Outlook 需要 32 位版本的 dll,而 64 位版本不起作用。 Three questions:
三个问题:
Thanks,谢谢,
Paul保罗
Your addin is always running with the same bitness as Outlook, just compile it as "Any CPU".您的插件始终以与 Outlook 相同的位数运行,只需将其编译为“任何 CPU”即可。
Keep both dlls (or embed them as resource), and at run-time determine the bitness by evaluating the size of the IntPtr type - 4 for 32 bit, and 8 for 64. Then extract/load the dll of the right bitness.保留两个 dll(或将它们作为资源嵌入),并在运行时通过评估 IntPtr 类型的大小来确定位数 - 32 位为 4,64 位为 8。然后提取/加载正确位数的 dll。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.