Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jayprajapati857/eaf2a25ba6086644bdc98b42aae80947 to your computer and use it in GitHub Desktop.

Select an option

Save jayprajapati857/eaf2a25ba6086644bdc98b42aae80947 to your computer and use it in GitHub Desktop.

Revisions

  1. @pishangujeniya pishangujeniya created this gist May 15, 2019.
    30 changes: 30 additions & 0 deletions MySQL5.7-EntityFramework-Guide.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    ## Installing MySQL 5.7 Server with EntityFramework in Visual Studio 2017

    - Install [MySQL Server 5.7.25](https://dev.mysql.com/downloads/mysql/)
    - Install Complete [MySQL Connector.Net 6.9.10](https://dev.mysql.com/downloads/connector/net/)
    - Install Complete [MySQL Visual Studio Plugin 1.2.8](https://dev.mysql.com/downloads/windows/visualstudio/)
    - If after installing MySQL Visual Studio Plugin it shows warning that failed to execute comamnd `devenv /updateconfiguration`, then manually execute that command in **Developer Command Prompt for Visual Studio 20xx** with run as administrator.
    - Right Click References > Add > Click Assemblies or Extensions > Search *MySQL* > Tick all

    - Comment the following kind of similar code from `Web.config`
    ```xml
    <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, 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>
    ```
    - Add this lines if its not automatically added after ```</runtime>``` tag in `Web.config` and rebuild solution
    ```xml
    <entityFramework>
    <defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
    <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>
    ```