.net - Nuget System.Data.SqlClient 破坏了我的项目

标签 .net visual-studio-2015 nuget-package

我使用 NuGet 包管理器安装了 System.Data.SqlClient,但立即收到此错误:

There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Microsoft.AspNet.Scaffolding.EntityFramework.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, 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

它不允许我下载新的软件包,因此我通过将其添加到我的网络配置中来解决这个问题:

<Compilation>
    <Property Name="PlatformTarget">x86</Property>
</Compilation>

然后,当我尝试安装新软件包时,出现此错误:

An error occurred while retrieving package metadata for 'System.Data.SqlClient.4.1.0' from source 'Path/To/Project/packages'.

所以我想我只需删除 Nuget 包即可,但我得到了

Object reference not set to an instance of an object

每当我尝试删除它时。

我尝试过的事情:

  • 在“程序包管理器设置”中更改程序包管理器源
  • 使用 System.Data.SqlClient.4.1.0 删除文件夹

我在 Windows 10 上使用 VS 2015

有人可以帮我解决吗?

谢谢

最佳答案

所以最终对我有用的是进入包配置并使用 sqlclient 删除条目。

关于.net - Nuget System.Data.SqlClient 破坏了我的项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38506420/

相关文章:

c# - 单击一次部署。该应用程序需要该程序集 MSDATASRC 版本

.net - InstallShield Limited Edition 2015 警告 -6245 需要 .Net Framework

azure - 自 Asp.net5 RC1 更新后无法再发布

c# - 如何以正确的方式将 nuget 包添加到 package.config?

visual-studio - 如何在 Visual Studio 外使用包管理器控制台 powershell

azure - VSTS Build vNext NuGet 自定义包源

.net - 是否可以在运行时将接口(interface)分配给对象?

.net - Keys.Control/Shift 和 Keys.ControlKey/ShiftKey 之间的确切区别是什么?

c# - 我必须在 Windows 服务中实现 Stop 方法吗?

c++ - 错误 C2893 函数模板专用化失败 'unknown-type std::invoke(_Callable &&,_Types &&...)'