Chu*_*age 4 mysql entity-framework visual-studio-2013
我已经尝试过我在网上找到的所有解决方案都没有成功.我不断得到错误:
Running transformation: System.InvalidOperationException: The SSDL generated by the activity
called 'CsdlToSsdlAndMslActivity' is not valid and has the following errors:
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. See http://go.microsoft.com/fwlink/?LinkId=260882 for
more information.
Run Code Online (Sandbox Code Playgroud)
我有一个空的Console项目和一个非常基本的模型来测试它.通过NuGet包控制台我会执行:Install-Package MySQL.Data.Entities里面装EF6,MySQL.Data并MySQL.Data.Entities和迷上了所有引用和复制相关的DLL的到bin/Debug文件夹中.
我在下面连接了提供程序(列出了整个配置文件)
<?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" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6"></provider>
</providers>
</entityFramework>
</configuration>
Run Code Online (Sandbox Code Playgroud)
据我所知,我已经注册了提供商.我也更新了最新的MySQL连接器.我哪里错了?
要支持完整功能,EF Designer需要3件事:
因为你似乎没有或使用工作流/ T4 for MySQL(注意我不知道这是因为你没有选择正确的T4 /工作流程(见上文)或MySQL DDEX不支持这个或安装无论出于何种原因而破坏)EF Designer正在使用Sql Server的默认工作流程.默认工作流依赖于能够在默认路径中找到EF提供程序(对于SqlServer和SqlServerCe),但MySQL的提供程序不存在 - 因此出错.请注意,用于创建DDL的工作流和T4模板是特定于提供程序的,因此即使您将MySQL提供程序复制到默认路径它也不会真正起作用 - 您将获得使用MySQL类型的SQL Server特定SQL脚本的特殊结果.
我们有一个错误,通过提供更好的指导而不是仅仅调用我们知道不起作用的默认DDL生成来改进这一点.您还可以在此错误中找到一些详细信息.
我建议检查你使用的MySQL组件是否支持Model First.另一种方法是转移到Code First,它只需要您已经拥有的EF运行时提供程序来生成DDL.
| 归档时间: |
|
| 查看次数: |
4720 次 |
| 最近记录: |