大家好,又见面了,我是你们的朋友全栈君。
最近在用EF搭框架的过程中,遇到了很多问题,大部分都是出现在配置文件中,比如说下面这个问题:
问题描述:error 0152: No Entity Framework provider found for the ADO.NET provider with invariant name ‘MySql.Data.MySqlClient’. Make sure the provider is registered in the ‘entityFramework’ section of the application config file。
这么长的问题,刚开始看都晕了。仔细看就是少了“MySql.Data.MySqlClient”的provider,于是到配置文件中去查找,发现确实没有相关内容。
<entityFramework>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
仔细观察会发现这个是SQL Server的。
经过查资料发现出现问题的原因应该是缺少了MySql的引用,添加上引用后就解决啦!不过感觉这还不是出现问题的根本原因,等弄明白了再来完善。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/105737.html原文链接:https://javaforall.cn
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有