使用三层架构+EF添加单元测试

岁酱吖の 提交于 2019-12-03 15:05:44

在运行测试的时候抛异常了:

“System.InvalidOperationException”类型的异常在 mscorlib.dll 中发生,但未在用户代码中进行处理

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.

经过一些列的百度最后,看到这篇博客https://blog.csdn.net/haipurui0001/article/details/79355160的一句话,就尝试了一下,居然成功了

奈何本人梅闻花,只能把这4个都引用进去(这四个dll都可以在当前项目的packages中可以找到)

 

 将这些dll引入后,再次测试成功了,做一下笔记

 

 

 

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!