c# - 处理器架构不匹配构建错误

标签 c# android build xamarin visual-studio-2015

在尝试运行测试应用程序时,我两次收到以下错误:

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".

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. TestMobile.Core mismatch MSIL x86

我安装了 .NET Framework,以及 Windows 8 SDK 工具并使用 MultilingualAppToolKit。

我已经验证了配置管理器,一切似乎都很好。平台目标,针对“任何 CPU”

最佳答案

复制我现有版本的 .NET 可移植库引用程序集为我解决了这个问题。

我在安装 Visual Studio 2015 Update 3 补丁后遇到了这个问题,阅读了 vvolkgang 的回复并最初打了折扣,因为我已经在 C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\中有了文件夹.NETPortable,并且这些文件夹的日期晚于我下载的引用程序集存档中包含的日期。我应该做的是检查文件夹层次结构的正确部分。查看您的项目文件;在我的例子中,我有这些设置:

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

如果这些是您的设置,您需要检查 C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile49 的内容。如果您使用不同的配置文件或针对不同版本的框架,请相应地调整路径。当我检查那个文件夹时,我发现我有很多 XML 文件但没有 DLL;从 Microsoft .NET Portable Library Reference Assemblies 4.6 复制文件并选择不替换任何已存在的文件解决了我的构建问题。

关于c# - 处理器架构不匹配构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32824080/

相关文章:

groovy - 梯度错误 "Execution failed for task ' :app:compileDebugJava' "while build groovy in android studio

svn - Hudson:我如何使用参数化构建来执行 svn checkout 和 svn 标记?

c# - 需要使用大于或小于来比较两个通用对象

c# - 提高图像的打印质量

c# - Math.Round 不保留尾随零

Android 如何在启动时创建不存在的数据库,然后在下一次启动时检索它

android - 在某些情况下如何禁用 ViewPager 对某些 child 的分页?

c# - Xamarin.Forms Picker ItemsSource在XAML中保持为空

Android,finish()关闭应用程序而不是 Activity

java - Android Studio 构建文件 R 损坏