实体数据模型不显示MySql选项

4

我正在使用xampp xampp-win32-5.6.15-1-VC11-installer.exe和MySQL Connector Net 6.6.4,将以下文件添加到我的MVC项目中:

  • MySql.Data
  • MySql.Data.Entity
  • MySql.Web

enter image description here

我的 web.config

 <?xml version="1.0" encoding="utf-8"?>
<!--
  Para obtener más información sobre cómo configurar la aplicación de ASP.NET, visite
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

    <configuration>
      <appSettings>
        <add key="webpages:Version" value="2.0.0.0" />
        <add key="webpages:Enabled" value="false" />
        <add key="PreserveLoginUrl" value="true" />
        <add key="ClientValidationEnabled" value="true" />
        <add key="UnobtrusiveJavaScriptEnabled" value="true" />
      </appSettings>

      <system.web>

        <httpRuntime targetFramework="4.5" />

        <compilation debug="true" targetFramework="4.5" />

        <pages>
          <namespaces>
            <add namespace="System.Web.Helpers" />
            <add namespace="System.Web.Mvc" />
            <add namespace="System.Web.Mvc.Ajax" />
            <add namespace="System.Web.Mvc.Html" />
            <add namespace="System.Web.Routing" />
            <add namespace="System.Web.WebPages" />
          </namespaces>
        </pages>
      </system.web>

      <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />

      <handlers>
          <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
          <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
          <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
          <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
          <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
          <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
        </handlers></system.webServer>
    </configuration>

当我尝试添加实体数据模型时,没有MySQL选项。
1个回答

2

我卸载了旧的MySQL Connector Net 6.6.4,然后安装了新版本6.8.7,但错误仍然存在,我正在使用Visual Studio 2013。 - luciano cba
我尝试将以下代码添加到我的web.config文件中:<system.data> <DbProviderFactories> <remove invariant="MySql.Data.MySqlClient"/> <add name="MySQL数据提供程序" invariant="MySql.Data.MySqlClient" description=".Net框架的MySQL数据提供程序" type="MySql.Data.MySqlClient.MySqlClientFactory,MySql.Data" /> </DbProviderFactories> </system.data> - luciano cba
连接器应与2013兼容。在这里看看:http://dev.mysql.com/doc/connector-net/en/connector-net-visual-studio-making-a-connection.html - Josh
我现在使用的连接器是6.8,受Visual Studio 2013支持,我尝试像你给我的最后一个链接一样操作,但错误仍然存在,新的数据库连接数据没有显示mysql选项。 - luciano cba
MySQL for Visual Studio 可以在服务器资源管理器中启用 MySQL 数据库选项,而 MySQL 数据连接器可以在实体数据模型向导下启用相同的选项。 - Pranesh Janarthanan

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接