构建 C# MVC 5 站点时项目之间的处理器架构不匹配 [英] Processor architecture mismatch between projects when building C# MVC 5 site

查看:40
本文介绍了构建 C# MVC 5 站点时项目之间的处理器架构不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到的错误如下...

The error I'm getting is as below...

2017 年 4 月 20 日13:23:38 C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5):警告 MSB3270:处理器之间存在不匹配正在构建的项目的架构MSIL"和处理器参考System.Data"、AMD64"的架构.这种不匹配可能会导致运行时失败.请考虑更改目标您的项目的处理器架构通过配置管理器,以便在您的处理器之间对齐处理器架构项目和引用,或依赖于带有与目标处理器匹配的处理器架构您项目的架构.[D:_atlassian-home\bamboo-home\xml-data\build-dir\blah\blah\blah.csproj]

build 20-Apr-2017 13:23:38 C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "System.Data", "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. [D:_atlassian-home\bamboo-home\xml-data\build-dir\blah\blah\blah.csproj]

我见过其他人有同样的问题,但在遵循他们的解决方案后,并没有改善我的情况(处理器架构不匹配构建错误).

I've seen other people have the same issue, but after following their solutions, it did not improve my situation (Processor architecture mismatch building error).

在解决方案上运行 MSBuild 时,会在我们的 CI 服务器 (Bamboo) 上发生这种情况.

This is happening on our CI server (Bamboo) when running MSBuild on the solution.

我很困惑,有人有什么想法吗?

I'm quite stumped, does anyone have any ideas?

推荐答案

首先,这真的只是一个警告.如果您只是处理 Amd64 依赖项,它应该不会有任何伤害.如果配置设置为任何 CPU,当其中一个程序集为 Amd64 编译时,这意味着它将不再在任何 CPU 上工作 - 它只能在 64 位 CPU 上工作.

First, it really is just a warning. It should not hurt anything if you are just dealing with Amd64 dependencies. If the configuration is set to any CPU, when one of the assemblies is compiled for Amd64, which implies that it will no longer work on any CPU - it'll work only on 64 bit CPU.

因为您有 Amd64 依赖项,所以从技术上讲,您的项目与任何 CPU"不兼容.要消除警告,您实际上应该将项目从任何 CPU"更改为x64".

Because you have an Amd64 dependency, technically your project is therefore not "Any CPU" compatible. To make the warning go away, you should actually change your project from "Any CPU" to "x64".

如果您仍然想使用Any CPU"配置您的项目,您可以编辑您的项目文件并添加此属性组和设置以禁用警告:

If you still want to configure your project with "Any CPU", you canedit your project file and add this property group and setting to disable the warning:

<PropertyGroup><ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch></PropertyGroup>

希望能帮到你.

这篇关于构建 C# MVC 5 站点时项目之间的处理器架构不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆