visual studio 2019 +EF+Mysql生成實體數據模型閃退解決方案


因為要為一個舊的應用寫擴展,用Code First模式寫,需要寫很多代碼,就想用EF6+MySql DB First模式。搗鼓了一晚上。最終找到解決方案:

1) Remove mysql for visualstudio

2) Remove mysql connector net

3) Install mysql for visualstudio 2.0.5

4) install mysql connector net 6.10.8

5) Create a new C# project using framework 4.5.2

6) Via Nuget, add Microsoft Entity Framework 6.2.0

7) Via Nuget, add MySql.Data.Entity 6.10.8
這里通過命令安裝:Install-Package MySql.Data.Entity -Version 6.10.8

8) Open App.config. There are errors in the row:

<provider invariantName="MySql.Data.MySqlClient" ...

add the missing '/' at the end and delete '</provider>'
9) Build the solution

Now add a new ADO.Net Entity Data Model and you should be able to work with your mysql database

參考:https://stackoverflow.com/questions/55642848/mysql-visual-studio-2019-integration


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM