Explained: EF 6 and “Could not determine storage version; a valid storage connection or a version hint is required.”

I have a legacy ASP.NET 3.5 web site that I’ve upgraded to a .NET 4 web application. At the same time, I upgraded to Entity Framework 6.

Suddenly one of the pages returned the following error:

[ArgumentException: Could not determine storage version; a valid storage connection or a version hint is required.]
   System.Data.SqlClient.SqlVersionUtils.GetSqlVersion(String versionHint) +11372412
   System.Data.SqlClient.SqlProviderServices.GetDbProviderManifest(String versionHint) +91
   System.Data.Common.DbProviderServices.GetProviderManifest(String manifestToken) +92

[ProviderIncompatibleException: The provider did not return a ProviderManifest instance.]
   System.Data.Common.DbProviderServices.GetProviderManifest(String manifestToken) +11431433
   System.Data.Metadata.Edm.Loader.InitializeProviderManifest(Action`3 addError) +11370982
   System.Data.EntityModel.SchemaObjectModel.Schema.HandleAttribute(XmlReader reader) +216

A search of the error message didn’t turn up anything helpful except that someone mentioned that the error messages was bogus in his case.

The page in question uses the ASP.NET EntityDataSource control, consumed by a Telerik RadGrid. This is a fabulous combination for putting a huge amount of functionality on a page in a very short time.

Unfortunately, the 6.0.1 release of EF6 doesn’t support EntityDataSource. According to the people in charge, support is planned but there’s no timeline for an EntityDataSource build that works with EF6.  I’m not sure what to do in the meantime. Should I back out EF6 or manually wire up the RadGrid?

The upshot is that you might want to rethink plans to upgrade to Entity Framework 6 for Web forms projects if they rely on that handy control.

It might also help to spend a User voice vote here:  http://data.uservoice.com/forums/72025-entity-framework-feature-suggestions/suggestions/3702890-support-for-asp-net-entitydatasource-and-dynamicda

2 Comments

  • I guess the problem is that the EntityDataSource control is expecting an "System.Data.Objects.ObjectContext", whereas EF6 is giving your an "System.Data.Entity.Core.Objects.ObjectContext".

    Have you tried the EFDataSources NuGet package? It claims to work with the DbContext directly, rather than the underlying ObjectContext, so it should still work.

  • Thanks for the warning!

Comments have been disabled for this content.