Hello,
I have just developed my sales site according to the following tutorial:
Which can be found on Microsoft here (mvc-music-store):
https://docs.microsoft.com/en-us/aspnet/mvc/overview/older-versions/mvc-music-store/
So I created a new project from Visual Studio 2017 and the result is super functional, so everything is fine.
I now plan to develop it on my existing site with the same Framework 4.7 (which already works with Mysql) and there at the HomeController level I get the following message:
System.Data.Entity.Core.ProviderIncompatibleException :
Provider did not return ProviderManifestToken string.
private List<Album> GetTopSellingAlbums(int count)
{
return storeDB.Albums
.OrderByDescending(a => a.OrderDetails.Count())
.Take(count)
.ToList();
}
I have in my Global.asax.cs the launch of the two Db...
protected void Application_Start()
{
DbConfiguration.SetConfiguration(new MySqlEFConfiguration());
Database.SetInitializer(new SampleData());
And this in the Web.config:
<connectionStrings>
<add name="Site_LsB_MVCEntities" providerName="System.Data.SqlServerCe.4.0" connectionString="Data Source=|DataDirectory|Site_LsB_MVC.sdf;" />
<add name="DefaultConnection" providerName="MySql.Data.MySqlClient" connectionString="server=localhost;port=***;database=_Bdd_MVC_Photo;userid=Bdd_MVC_Photo;password=****;persistsecurityinfo=True" />
<add name="TypeVisiteur" providerName="MySql.Data.MySqlClient" connectionString="server=localhost;port=****;database=_Visiteurs;userid=Bdd_MVC_Visiteur;password=****;persistsecurityinfo=True" />
</connectionStrings>
The two configs separately work well, but there is a problem when they are combined...
How to solve this problem, would it be because of the Provider?
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
<parameters>
<parameter value="System.Data.SqlServerCe.4.0" />
</parameters>
</defaultConnectionFactory>
<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, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
<provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
</providers>
</entityFramework>
For once I need a pro in the matter.
Thank you in advance.
What I have tried:
Quote:
<add name="Site_LsB_MVCEntities"
="" connectionstring="Data Source=.;Initial Catalog=Site_LsB_MVC;Integrated Security=SSPI" providername="System.Data.SqlClient">