c# – 在Visual Studio中创建实体框架6模型关闭向导并断开MYSQL连接数据库
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了c# – 在Visual Studio中创建实体框架6模型关闭向导并断开MYSQL连接数据库,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2466字,纯文字阅读大概需要4分钟。
内容图文
我试图使用Entity Framework 6将ADO.Net实体数据模型添加到Net.Framework类库中,但是当我进入步骤3时,当您选择Framework版本时,它立即关闭向导并自动关闭我的MYSQL数据库This is what it shows before it closes断开.
我的App.Config文件
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="MyContext" providerName="MySql.Data.MySqlClient"
connectionString="server=localhost;port=3306;database=mycontext;uid=root;password=********"/>
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
<providers>
<provider invariantName="MySql.Data.MySqlClient"
type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6"/>
<provider invariantName="System.Data.SqlClient"
type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
</providers>
</entityFramework>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.12.0" newVersion="8.0.12.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.6.1.0" newVersion="3.6.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
我已经使用NuGet安装了类库中的Entity Framework 6.20,Mysql.Data 8.0.12,MySql.Data.Entity 6.10.8,Google.Protobuf 3.6.1并添加为引用.我重新安装,更新,使用MYSQL安装程序,没有运气.
我有一个Net.Core Web API应用程序作为第一个项目,但我知道Net.core不支持Framework 6,只支持Entity核心,所以你必须添加net.framework类库并在libary.
只是要注意我不是(见图片)具有与“无法找到实体框架数据库提供程序”相同的错误我没有出现该错误,框架版本会自动选中,但它会关闭.谢谢.
编辑
对于遇到此问题的人,我有一个解决方法,我不得不从安装程序中卸载Net Connector并单独下载Net Connector 6.10.8,事情应该有效.
解决方法:
这是MySQL VS集成中的一个已知错误:bug 91195.
其他一些用户发布了他们在该链接中找到的解决方法.您可能需要等待Oracle发布不会崩溃的VS插件.
内容总结
以上是互联网集市为您收集整理的c# – 在Visual Studio中创建实体框架6模型关闭向导并断开MYSQL连接数据库全部内容,希望文章能够帮你解决c# – 在Visual Studio中创建实体框架6模型关闭向导并断开MYSQL连接数据库所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。