'A null was returned after calling the 'GetService' method on a store provider instance of type 'MySql.Data.MySqlClient.MySqlClientFactory'

I recently upgraded my database to mySQL 8.0.28, mySQL .NET Connector 8.0.28 & Entity Framework 6.4.4. Now when making a DB call from code I am receiving the error "System.Data.ProviderIncompatibleException: A null was returned after calling the 'GetService' method on a store provider instance of type 'MySql.Data.MySqlClient.MySqlClientFactory'. The store provider might not be functioning correctly."

web.config has

        <system.data>
        <DbProviderFactories>
        <remove invariant="MySql.Data.MySqlClient" />
        <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.28.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </DbProviderFactories>
  </system.data>


<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>      


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source