简体   繁体   English

处理器架构不匹配,构建错误

[英]Processor architecture mismatch building error

At trying to run a test application i obtain the following error twice: 在尝试运行测试应用程序时,两次出现以下错误:

There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\mscorlib.dll", "x86". 正在构建的项目“ MSIL”的处理器体系结构与引用“ C:\\ Windows \\ Microsoft.NET \\ Framework \\ v4.0.30319 \\ mscorlib.dll”,“ 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. 请考虑通过Configuration Manager更改项目的目标处理器体系结构,以使项目和引用之间的处理器体系结构保持一致,或者依赖于具有与项目目标处理器体系结构相匹配的处理器体系结构的引用。 TestMobile.Core mismatch MSIL x86 TestMobile.Core不匹配MSIL x86

I have .NET Framework installed, as well as windows 8 SDK tools and using MultilingualAppToolKit. 我已经安装了.NET Framework,以及Windows 8 SDK工具并使用MultilingualAppToolKit。

I already have verified the configuration manager and everything seems to be fine. 我已经验证了配置管理器,一切似乎都很好。 Platform target, targeting "Any CPU" 平台目标,目标为“任何CPU”

Copying over my existing version of .NET Portable Library Reference Assemblies fixed the issue for me. 复制现有版本的.NET可移植库参考程序集可以解决此问题。

I encountered this problem after installing a patch to Visual Studio 2015 Update 3, read vvolkgang's response and initially discounted it because I already had folders within C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETPortable , and the dates of those folders were later than those contained within the reference assemblies archive I had downloaded. 在安装Visual Studio 2015 Update 3补丁后,遇到vvolkgang的响应,并最初对其打了折扣,因为在C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETPortable和日期中已经存在文件夹,因此遇到了此问题。这些文件夹中的文件夹比我下载的参考程序集存档中包含的文件夹晚。 What I should have done was to check the right part of the folder hierarchy . 我应该做的是检查文件夹层次结构的正确部分 Take a look at your project file; 查看您的项目文件; in my case I had these settings: 就我而言,我具有以下设置:

<TargetFrameworkProfile>Profile49</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

If those are your settings, you need to check the contents of C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETPortable\\v4.5\\Profile\\Profile49 . 如果是这些设置,则需要检查C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETPortable\\v4.5\\Profile\\Profile49 If you're using a different profile or targeting a different version of the framework, adjust the path accordingly. 如果您使用其他配置文件或针对框架的其他版本,请相应地调整路径。 When I checked that folder, I discovered that I had lots of XML files but no DLLs; 当我检查该文件夹时,我发现我有很多XML文件,但没有DLL;这些文件没有。 copying the files from Microsoft .NET Portable Library Reference Assemblies 4.6 and choosing not to replace any files that already existed fixed my build issues. Microsoft .NET便携式库参考程序集4.6复制文件,并选择不替换任何现有文件,解决了我的生成问题。

Had this problem after installing Visual Studio 2015 Update 2. Try this, the first one solved my problem: 安装Visual Studio 2015 Update 2后出现此问题。尝试执行此操作,第一个解决了我的问题:

Install Portable Class Libraries v4.6 安装可移植类库v4.6

  1. Download Install the Portable Class Libraries v4.6 . 下载安装可移植类库v4.6 If you install this it puts a .zip file into the directory: "C:\\Program Files (x86)\\Microsoft .NET Portable Library Reference Assemblies 4.6" 如果安装此文件,则会将.zip文件放入目录中: "C:\\Program Files (x86)\\Microsoft .NET Portable Library Reference Assemblies 4.6"
  2. Unpack and copy the contents into "C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETPortable\\" 解压缩内容并将其复制到"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETPortable\\"

Install the PCL Tools 安装PCL工具

  1. Download Portable Class Library Tools 下载可移植类库工具
  2. Install by running PortableLibraryTools.exe /buildmachine 通过运行PortableLibraryTools.exe /buildmachine安装

Source: Matt Ward @ https://forums.xamarin.com/discussion/comment/80535/#Comment_80535 资料来源:马特·沃德@ https://forums.xamarin.com/discussion/comment/80535/#Comment_80535

I finnally was able to build my project without this filthy error. 最终,我能够构建我的项目而没有这个肮脏的错误。 It seems that i needed to install PortableLibraryTools from VS2010. 看来我需要从VS2010安装PortableLibraryTools。 It worked after that. 在那之后它起作用了。

Reference: http://forums.xamarin.com/discussion/25538/xamarin-xaml-example-problem-using-pcl 参考: http : //forums.xamarin.com/discussion/25538/xamarin-xaml-example-problem-using-pcl

如果您在构建服务器上并遇到此错误/警告,则只需安装MSBuild 17及其可选安装,其中包含所有SDK和Portable库。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 错误正在构建的项目的处理器体系结构 msil 与处理器体系结构不匹配 - Visual Studio error There was a mismatch between the processor architecture of the project being built msil and the processor architecture C#-处理器体系结构不匹配 - C# - processor architecture mismatch SoundTouchNet DLL处理器体系结构不匹配 - SoundTouchNet DLL processor architecture mismatch 构建C#MVC 5站点时项目之间的处理器体系结构不匹配 - Processor architecture mismatch between projects when building C# MVC 5 site 正在构建的项目的处理器架构不匹配 - Mismatch between the processor architecture of the project being built .NET参考在我的项目(类库)中不可用。 得到编译器错误“处理器体系结构之间不匹配” - .NET reference not available in my project (Class Library). Getting compiler error “mismatch between processor architecture” Xamarin 处理器架构构建错误 - Xamarin processor architecture build error 正在构建的项目“ MSIL”的处理器体系结构与参考文献“ AMD64”的处理器体系结构之间不匹配 - There was a mismatch between the processor architecture of the project being built “MSIL” and the processor architecture of the reference "AMD64 处理器体系结构与SQLite Nuget软件包和任何CPU Web项目不匹配 - Processor architecture mismatch with SQLite Nuget package and Any CPU web project 警告 MSB3270:项目的处理器架构不匹配 - warning MSB3270: mismatch between the processor architecture of the project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM