找不到参考System.Data.SqlClient [英] Reference System.Data.SqlClient not found

查看:459
本文介绍了找不到参考System.Data.SqlClient的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个全新的Visual Studio 2017 Professional安装。我正在使用.NET 4.7.1构建一个快速的POC控制台应用程序,我无法找到System.Data.SqlClient的引用。

I have a fresh Visual Studio 2017 Professional install. I'm building a quick POC Console application using .NET 4.7.1, and I'm unable to find the reference for System.Data.SqlClient.

我已经搜索了我的系统,并且找到4个版本的System.Data.SqlClient.dll,但没有一个是正确的,不会编译。

I have scoured my system, and located 4 versions of System.Data.SqlClient.dll, but none are correct and won't compile.

我也尝试过使用System.Data,但没有找到对SqlClient的引用我已经手动为System.Data添加了dll / reference,但是也没有解决引用问题。

I have also attempted to use System.Data, but no reference to SqlClient is located within.

我的应用程序确实是在内部。

I have manually added the dll/reference for System.Data, but also did not resolve the reference issue.

目前很简单,由于这个缺失的引用而无法编译。

My application is really simple at the moment, and it will NOT compile due to this missing reference.

我需要采取哪些步骤来解决这个问题?

What steps do I need to do to get this resolved?

我的using语句是:

my using statements are:

使用System;

使用System.Data;

using System.Data;

使用System.Data .SqlClient;

using System.Data.SqlClient;

谢谢,

Allan

推荐答案

此问题已解决。  Microsoft已从Visual Studio(.NET Core)的默认安装中删除了System.Data.SqlClient。要使用它,必须从NuGet安装为install-package System.Data.SqlClient。 安装完成后,此参考
可供使用,代码将编译。
This issue is resolved.  Microsoft has removed System.Data.SqlClient from the default installation of Visual Studio (.NET Core). In order to use it, you must install from NuGet as install-package System.Data.SqlClient.  Once installed, this reference is available for use and code will compile.


这篇关于找不到参考System.Data.SqlClient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆