MySql Connector 6.8.2 RC, Entity Framework 6 i Code First

Niedawno dokonałem aktualizacji do Entity Framework 6 i zainstalowałem MySql 6.8.2 RC Connector, ponieważ stwierdził, że teraz jest wsparcie dla kodu EF6.

Pamiętaj, że przed aktualizacją mój projekt działał poprawnie działając w łączniku 6.7.4 i EF 5.

Wprowadziłem następujące zmiany w moim web.config

<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, Version=6.8.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
  <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>

<connectionStrings>
<add providerName="MySql.Data.MySqlClient" name="dbcontext" connectionString="Server=localhost; Database=db; Uid=un; Pwd=pw;Convert Zero Datetime=True" />
</connectionStrings>

Dodałem również następujące odniesienia (wersje .net 4.5)

MySql.DataMySql.Data.Entity.EF6MySql.Web

Problem polega na tym, że w momencie wywołania kodu DBContext otrzymuję:

Object reference not set to an instance of an object.

Ponownie - pamiętaj, że wszystko działało przed aktualizacją, więc wiem, że nie jest to problem z kodem, ale może nie skonfigurowałem poprawnie web.config?

Ponadto - możesz zapytać, czy działało dobrze przed aktualizacją, po co aktualizować? Cóż, podobno EF6 i nowy łącznik MySql rozwiązują niektóre błędy, w których brałam udział - miałam więc nadzieję, że zaimplementuję go teraz, podczas gdy jego rozwój i czas przejścia do produkcji (za kilka miesięcy) powinienem być w stanie załadować wersja produkcyjna złącza 6.8.x.

Oto ślad stosu na wypadek, gdyby to pomogło

[NullReferenceException: Object reference not set to an instance of an object.]
MySql.Data.MySqlClient.MySqlProviderServices.GetDbProviderManifestToken(DbConnection connection) +85
System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +332
System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection) +67
System.Data.Entity.Infrastructure.<>c__DisplayClass1.<ResolveManifestToken>b__0(Tuple`3 k) +63
System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +72
System.Data.Entity.Infrastructure.DefaultManifestTokenResolver.ResolveManifestToken(DbConnection connection) +260
System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest& providerManifest) +89
System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection) +79
System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext) +143
System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input) +171
System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +594
System.Data.Entity.Internal.InternalContext.Initialize() +31
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +39
System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +138
System.Data.Entity.Internal.Linq.InternalSet`1.Include(String path) +41
System.Data.Entity.Infrastructure.DbQuery`1.Include(String path) +142
[edited].Global.Application_BeginRequest(Object sender, EventArgs e) in c:\edited\Global.asax.cs:47
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

questionAnswers(2)

yourAnswerToTheQuestion