使用 32 位或 64 位 dll 编译 .net 应用程序

使用 32 位或 64 位 dll 编译 .net 应用程序

问题描述:

我有一个我们在工作中编写的应用程序,它使用 SVN 的 SharpSVN 包装器.在过去的几年里,它对我们很有帮助.但是,我们已经开始引入 64 位系统,我们的应用程序似乎无法访问这些系统上的 SharpSVN dll.

I have an application that we wrote here at work that uses the SharpSVN wrapper for SVN. It has served us well of the past few years. However, we have started bringing in 64-bit systems and our application cannot seem to access the SharpSVN dll on these systems.

我已经下载了 64 位版本的 SharpSVN dll,我想知道下一步该怎么做.我无法阻止我的 32 位用户使用该应用程序,因此我需要能够为两个平台进行编译.幸运的是,在此应用程序中,我们将 ntier 堆栈的不同层拆分为解决方案中的单独项目,因此我使用 SharpSVN dll 的业务层是独立的.

I have downloaded the 64-bit version of the SharpSVN dll and I am wondering what to do next. I cannot stop my 32-bit users from using the application, so I need to be able to compile for both platforms. Luckily, with this application, we split different layers of the ntier stack into separate projects within the solution so my business layer that utilizes the SharpSVN dll is on its own.

如何在无需维护项目的两个副本的情况下编译 32 位和 64 位版本的应用程序?

How would I go about compiling both a 32-bit and 64-bit version of my application without having to maintain two copies of the project?

从描述来看,听起来您的 vb.net 应用程序是使用 Any CPU 选项构建的,这意味着它可以作为64 位机器上的 64 位应用程序.在这种情况下,它不会加载 32 位 DLL.

From the description, it sounds like your vb.net application is built with the Any CPU option, which means it would run as a 64-bit application on a 64-bit machine. In that case, it would not load the 32-bit DLL.

与其尝试同时使用 32 位和 64 位版本,不如将其更改为以 32 位运行.更简单的部署.在项目属性构建选项卡下,选择 x86.

Rather than try to use both a 32-bit and 64-bit version, you should be able to just change it to run as 32-bit. Simpler deployment. Under the project properties build tab, choose x86.