c# - 正在构建的项目 "MSIL"的处理器架构与引用“AMD64”的处理器架构不匹配

标签 c# c++ .net visual-studio-2012 architecture

我有一个 Visual Studio 2012 .Net 主项目,其构建属性中指定了平台目标 x86。该项目由多个C++项目和C#项目组成。在我的配置管理器中,C# 项目的平台是 Any CPU,C++ 项目的平台是 Win32。我想引用一个针对 AMD64 的第三方 dll。添加引用时,我收到以下警告:

Warning: Warning: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "DALSA, processorArchitecture=AMD64", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

如果我尝试为平台目标 x64 更改主 C# 项目构建,它会提示,因为它依赖的外部 DLL 具有平台目标 x86。

任何我在做什么wr0ng?

最佳答案

所以你有两只左脚鞋,没有一只右脚鞋。如果你想走路,你应该以某种方式得到一双合适的鞋子。获取 x86 DALSA 或 Win64 外部 DLL。

单个进程不可能运行在不同的架构上。

唯一的其他选择是创建一个辅助进程,主进程将连接到一些 IPC就像管道一样,它将运行在互补的架构上。或者用 COM 对象包装 DLL。

关于c# - 正在构建的项目 "MSIL"的处理器架构与引用“AMD64”的处理器架构不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27516412/

相关文章:

c# - 使用键盘选择列表框项目

c# - 作为源的 SSIS 脚本组件抛出 System.NullReferenceException

c++ - cpp中指针的类型转换

c++ - 多次使用 Promise

java - 是否有任何 .NET/JAVA 免费或开源垃圾邮件检测器可以产生良好的结果?

.net - 你如何指定一个方法只能被单元测试调用?

c# - 匿名类的 ASP.NET MVC ViewBag 列表在 Count() 方法上抛出错误

c# - 在 C# 中将总时间转换为分钟

c++ - 检查图像是否均匀

.net - 单击一次-所有用户