C# MVC EF配置失败

1、报错信息:

  The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.

开始我以为是web.Config配置问题:

connectionStrings如下:

<connectionStrings>
<add name="EFDbcontext" providerName="System.Data.SqlClient" connectionString="Server=(local);Database=ReportServer;Integrated Security=True;"/>
</connectionStrings>

虽然我肉眼凡胎,但是我觉得我还是没错哒。。但是又找不出来。。。

百度了一下, 感谢这位大神,贴上地址

https://www.2cto.com/database/201511/449573.html

我仔细的查看了我主程序中的Bin文件,果然发现缺少了EntityFramework.SqlServer.dll的文件。。。然后我看了他一眼,嗯,可以复制到本地。重新生成解决方案...没有用。。

我默默的直接去把所有缺少的EntityFramework的dll文件和xml文件从这个文件夹复制到另一个文件夹。他果然好了~~~~~~~

 

2、数据库配置

   web Application-->  app_data -->  右击 添加新建项  添加 数据库实例  

(好吧,我得承认在这方面我还很菜)

 

 

虽年少轻狂,但我有我之梦想~~~~

 

posted @ 2020-06-30 21:53  小生晓梦  阅读(125)  评论(0编辑  收藏  举报