mysql - Visual Studio 2015 仅在尝试创建 ADO.NET 实体模型类时显示 SQL Server 连接
问题描述
我之前已经创建了一个 MySQL 数据库实例,如Code Review 上的这个问题中所述。我已经完成了数据库,并准备在 Visual Studio 2015 中使用 C# 创建应用程序。
我在 stackvoverflow.com 上找到的唯一一个似乎相关的问题就是这个问题。
我一直在使用这些页面中的 MySQL 文档:
连接器/ NET 实体框架 6.0
环境是 Windows 10,regedit 图像显示 .net 框架版本。本周早些时候,我将 MySQL 升级到了 8.0.11 版本。包管理器控制台:PM> get-package
Id 版本 ProjectName
-- -------- ------------
EntityFramework {6.2.0} bkInventory2App
Google.Protobuf {3.5.1} bkInventory2App
MySql.Data {8.0.11} bkInventory2App
MySql .Data.EntityFramework {8.0.11} bkInventory2App
应用程序配置
<?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>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<connectionStrings>
<add name="MySQLBKLibInventory" providerName="MySql.Data.MySqlClient" connectionString="SERVER=localhost;DATABASE=pacswlibinvtool;UID=root;PASSWORD=******;" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, 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>
</configuration>
解决方案
请注意,倒数第二张图片显示已安装的 MySQL 应用程序,未安装 MySQL for Visual Studio。安装 MySQL Visual Studio 纠正了这个特定的配置问题。
推荐阅读
- azure - Azure Text to Speech 突然开始返回“400 Bad Request”
- python - Python Modular Divison - 如何显示商和余数
- angular - 将插件集成到 froala 编辑器中
- php - 如何通过 Wordpress REST 创建 cookie
- python - 用日期重命名列标题
- sql - SQL - 如何从总数中删除已计算的内容
- python - Fbprophet / pystan
- python - Pandas Styler 未按预期将数据帧打印到 Spyder 的控制台
- html - CSS:从输入字段中删除“必需”标签后,选择器动画停止正常工作
- asp.net-mvc - 如何将此 SQL 转换为 Linq 语句?