【发布时间】:2016-12-21 06:03:06
【问题描述】:
我正在尝试创建将连接到 SQL 服务器并运行存储过程的 Web API。我想将System.Data.SqlClient 安装到项目中,以便提供连接详细信息。但是当试图通过Nuget Manager 安装它时,它会抛出类似
Install failed. Rolling back...
Could not install package 'System.Data.SqlClient 4.3.0'.
You are trying to install this package into a project that targets.
'.NETFramework,Version=v4.5', but the package does not contain any
assembly references or content files that are compatible with that
framework. For more information, contact the package author.
我该如何安装它们,或者有没有其他方法可以在web.config 中提供连接字符串
【问题讨论】:
-
为什么不给项目添加dll?
-
我在参考程序集中没有看到它们
-
您使用的是哪个 nuget 版本?
-
如何查看我们的版本
-
在 Visual Studio 中,使用帮助 > 关于 Microsoft Visual Studio 命令并查看 NuGet 包管理器旁边显示的版本。
标签: c# asp.net asp.net-web-api nuget-package