在Visual Studio中制作Entity Framework 6模型会关闭向导并断开MYSQL连接数据库的连接 [英] Making an Entity Framework 6 Model in Visual Studio closes Wizard and disconnects MYSQL Connection Database

查看:72
本文介绍了在Visual Studio中制作Entity Framework 6模型会关闭向导并断开MYSQL连接数据库的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将使用实体框架6的ADO.Net实体数据模型添加到Net.Framework类库中,但是当我进入第3步时,当您选择框架版本时,它将立即关闭向导,并关闭与我的连接MYSQL数据库这是关闭前显示的内容自动断开连接.

Im trying to add a ADO.Net Entity Data Model using Entity Framework 6 to a Net.Framework Class Library, but when I get to Step 3, when you choose the Framework version it immediately closes the wizard and my connection to my MYSQL Database This is what it shows before it closesautomatically disconnects.

我的App.Config文件

My App.Config file

<?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 Installer,但运气不佳.

I have installed Entity Framework 6.20, Mysql.Data 8.0.12, MySql.Data.Entity 6.10.8, Google.Protobuf 3.6.1 installed in the class library with NuGet and added as references. And I have reinstalled, updated, used the MYSQL Installer them with no luck.

我也有一个Net.Core Web API应用程序作为第一个项目,但是我知道Net.core不支持Framework 6,仅支持实体核心,因此您必须添加net.framework类库并添加它们.库中的参考文献.

I have an Net.Core Web API Application as the first project as well, but I know that Net.core does not support Framework 6, only Entity core, so you have to add the net.framework class library and add those references in the libary.

请注意,我不是(参见图片)与找不到实体框架数据库提供程序"具有相同的错误,但没有该错误,框架版本会自动选择,但关闭.谢谢.

Just to note I'm not (See Picture) having the same error as "An entity Framework database provider could not be found" I'm not having that error, the framework version is automatically selected, but it closes. Thank you.

编辑

对于遇到此问题的人,我有一种解决方法,我必须从安装程序中卸载Net Connector,然后单独下载Net Connector 6.10.8,然后一切正常.

For those who come across this problem I have a workaround, I had to uninstall the Net Connector from the Installer and download Net Connector 6.10.8 separately and things should work.

推荐答案

这是MySQL VS集成中的一个已知错误:错误91195 .

This is a known bug in MySQL VS integration: bug 91195.

其他一些用户发布了在该链接上找到的解决方法.您可能需要等待Oracle发布不会崩溃的VS插件.

Some other users have posted workarounds that they've found at that link. You may need to wait for Oracle to release a VS addin that doesn't crash.

这篇关于在Visual Studio中制作Entity Framework 6模型会关闭向导并断开MYSQL连接数据库的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆