編輯:發現這個職位和這個工作,但不得不從贏形式運行:試圖從數據庫中首先獲得MySQL的代碼工作
Enable Entity Framework 6 for MySql (C#) in WinForms of Microsoft Visual Studio 2013
OP ------- -------------
我創建了一個控制檯C#應用程序
- 當我右鍵單擊我的凸出ECT,
- 轉到添加新的項目,
- 我添加ADO.Net實體數據模型稱爲模型1
- 然後我選擇MySQL連接和命中完成
什麼也沒有發生。它只關閉嚮導,什麼都不做。
任何人都遇到過這個問題?
我已經安裝了MySQL的VISAUL工作室計劃,並同時運行此命令NPM:
Install-Package Mysql.Data.Entities
我的App.config看起來是這樣的:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<entityFramework>
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient"></remove>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.8.3.0" />
</DbProviderFactories>
</system.data>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.8.5.0" newVersion="6.8.5.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
檢查在事件查看器,看看是否有相關的錯誤日誌或警告。 (移動回答評論) – AndroidMechanic