.NET 参考在我的项目中不可用(Class 库)。获取编译器错误 "mismatch between processor architecture"
.NET reference not available in my project (Class Library). Getting compiler error "mismatch between processor architecture"
我有一个 Class 库,它需要 .NET
引用才能工作,因为它使用了很多 System
API,但我无法从 [=14] 添加引用=]对话框。 .NET
引用在 Reference Manager
中的 Assemblies
下不可用。
这是我的项目的样子,当我构建这个项目时出现以下错误:
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.
以下是我的 Reference Manager 的截图
我想要 .NET
参考图片 below.Any 我该如何解决这个问题?提前致谢:)
要添加众多 .NET 库之一,请右键单击 "References" 和 select "Add Reference"。
打开的对话框左侧有一个菜单,.NET 库可以在 "Assemblies" -> "Framework".
下找到
例如,System.Web.Services
。 (本身没有“.NET参考”...它被分成许多程序集)。
找到了这个问题的答案。
为了解决进程架构不匹配问题,我遵循了以下步骤:
首先我卸载了项目中的 nuget
个包。
然后我打开了我项目的属性。左键单击您的项目并打开 Properties
。
单击左侧面板中的 Library
,然后在 Targets
下单击 Change
。如果 .NET Framework
被选中,请取消选中并单击 Ok
保存。
然后重新安装 nuget
包并重新构建。它就像一个魅力。似乎 Visual Studio 2017 自动添加了 .NET
引用。我相信它是 VS 2017 中的一个错误
我有一个 Class 库,它需要 .NET
引用才能工作,因为它使用了很多 System
API,但我无法从 [=14] 添加引用=]对话框。 .NET
引用在 Reference Manager
中的 Assemblies
下不可用。
这是我的项目的样子,当我构建这个项目时出现以下错误:
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.
以下是我的 Reference Manager 的截图
我想要 .NET
参考图片 below.Any 我该如何解决这个问题?提前致谢:)
要添加众多 .NET 库之一,请右键单击 "References" 和 select "Add Reference"。
打开的对话框左侧有一个菜单,.NET 库可以在 "Assemblies" -> "Framework".
下找到例如,System.Web.Services
。 (本身没有“.NET参考”...它被分成许多程序集)。
找到了这个问题的答案。
为了解决进程架构不匹配问题,我遵循了以下步骤:
首先我卸载了项目中的 nuget
个包。
然后我打开了我项目的属性。左键单击您的项目并打开 Properties
。
单击左侧面板中的 Library
,然后在 Targets
下单击 Change
。如果 .NET Framework
被选中,请取消选中并单击 Ok
保存。
然后重新安装 nuget
包并重新构建。它就像一个魅力。似乎 Visual Studio 2017 自动添加了 .NET
引用。我相信它是 VS 2017 中的一个错误