异常: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.

    方法1

      网上找到这样一个方法,在代码中添加:

      public void FixEfProviderServicesProblem()
      {
        //The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer'
        //for the 'System.Data.SqlClient' ADO.NET provider could not be loaded.
        //Make sure the provider assembly is available to the running application.
        //See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.

        var instance = System.Data.Entity.SqlServer.SqlProviderServices.Instance;
      }

      本段代码并未使用;至于为什么会消除异常,还待深入了解。但这不是一个好的解决方法,它可能会引起另外一些问题。

     方法2

      在配置有Entity Framework的子项目中,有几个DLL如下:

      

      出现异常的原因主要是缺少了EntityFramework.DynamicFilters.dll、EntityFramework.SqlServer.dll、EntityFramework.SqlServer.xml。将这三个文件拷贝到主项目中,即可。

最新文章

  1. Log4net - 项目使用的一个简单Demo
  2. [LeetCode] Balanced Binary Tree 平衡二叉树
  3. too many open files 报错
  4. Maven 上传 jar包 到私服
  5. could not insert new action connection could not find any information for the class named
  6. java的static块执行时机
  7. POJ 3450 Corporate Identity(KMP)
  8. vsftp 虚拟用户
  9. Django之modelform组件
  10. 【R】资源整理
  11. CSS3 之 Media(媒体查询器)
  12. HTML 09 web 内容与攻击技术
  13. Java语言中的值传递与引用传递
  14. 终端工具putty访问vmware centos系统
  15. post接口_form表单上传
  16. mock static方法
  17. 51nod 1202 不同子序列个数(计数DP)
  18. Python网络编程之基础
  19. ruby 从命令行读取文本
  20. python入门:最基本的用户登录

热门文章

  1. elasticsearch客户端连接选择
  2. html,移动端代码
  3. UICollectionView介绍
  4. Spring 文章推荐
  5. maven常见错误
  6. tcp粘包,udp丢包
  7. App.xaml.cs
  8. noi 4978 宠物小精灵之收服
  9. ajax 另外两种返回类型(json xml)
  10. 【转载】详解CreateProcess调用内核创建进程的过程