文章内容

2017/7/27 17:39:21,作 者: 黄兵

No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'.

今天在写代码的时候,报了如下错误:

其他信息: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.

截图如下:

解决方案:

点击“工具”-> "NuGet 包管理器"如下图所示:

看看app.config文件,增加了如下内容:

<entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="mssqllocaldb" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>

点击‘确定“之后,就可以解决这个问题了。

黄兵的个人博客原创。

转载请注明出处:黄兵的个人博客 - No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'. 

分享到:

发表评论

评论列表