.net 如何修复处理器架构之间的不匹配?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25063268/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I fix a mismatch between processor Architectures?
提问by ShaunP
I have a number of projects that I have combined in my project. The error message I get is this:
我在我的项目中合并了许多项目。我得到的错误信息是这样的:
There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Interop.Domino, Version=1.2.0.0, Culture=neutral, processorArchitecture=x86", "x86". 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.
正在构建的项目的处理器架构“MSIL”与参考“Interop.Domino,版本=1.2.0.0,Culture=neutral,processorArchitecture=x86”,“x86”的处理器架构之间存在不匹配。这种不匹配可能会导致运行时失败。请考虑通过配置管理器更改项目的目标处理器架构,以便在您的项目和参考之间对齐处理器架构,或者依赖于具有匹配项目目标处理器架构的处理器架构的参考。
I have found this linkwhich gives some interesting information.
我找到了这个链接,它提供了一些有趣的信息。
However when I open up the Configuration Manager, everything looks fine:
但是,当我打开配置管理器时,一切看起来都很好:


Any idea of what I can do to get rid of this compiler message?
知道我可以做些什么来摆脱这个编译器消息吗?
采纳答案by Donogst
To me this looks like the Interop.Domino Library you're referencing is specifically for 32bit (x86) programs. You can either try to find a 64 bit version of the library and reference that instead or change the compile type of your programs.
对我来说,这看起来像是您引用的 Interop.Domino 库专门用于 32 位 (x86) 程序。您可以尝试找到库的 64 位版本并引用它,或者更改程序的编译类型。
You can do this by opening the properties page for each of your projects and setting the Platform target to x86.
为此,您可以打开每个项目的属性页面并将平台目标设置为 x86。
You might like to create an X86 Configuration in Configuration manager first, partly to test it out on and partly so it has the right name when you look at it later.
您可能希望首先在配置管理器中创建一个 X86 配置,部分是为了测试它,部分是为了在您稍后查看它时具有正确的名称。
Hope this helps
希望这可以帮助
回答by dodexahedron
It is complaining about a reference for one of your projects. Specifically, Interop.Domino. I'm assuming that's something to do with Domino, which likely means you have no control over it.
它正在抱怨您的一个项目的参考。具体来说,Interop.Domino。我假设这与 Domino 有关,这可能意味着您无法控制它。
There's very little chance that it will be an issue, if you are in a Windows environment on Intel or AMD processors.
如果您在使用 Intel 或 AMD 处理器的 Windows 环境中,那么它成为问题的可能性很小。
If you don't need the ability for this application to address more than ~2GB of memory, then go ahead and compile the project referencing it in x86 mode as well, if you're worried about the warning.
如果您不需要此应用程序寻址超过 2GB 内存的能力,那么如果您担心警告,请继续并在 x86 模式下编译引用它的项目。

