我使用 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/