Could not determine storage version - Entity Framework

妖精的绣舞 提交于 2019-12-01 17:42:01

问题


I'm implementing code first pattern in a separate project in my current solution. Since I did this and I initialize my connection string in DbContext I get this weird error:

Could not determine storage version; a valid storage connection or a version hint is required.

I'm using Entity Framework 5.0.0.0 and the rest of my solutions projects work great as they use EDMX files for database access yet only my code first project throws this exception. What is it and why?


回答1:


Solved the same issue with:

Go to Solution Explorer

  1. Right click on "xxx.edmx" file
  2. Select "Open with" >> Editor XML Editor
  3. Change ProviderManifestToken="XXXX" with 2008



回答2:


It seems problem got solved when I upgraded Entity Framework for every project using it to Entity Framework 6.1.2.

Works like a charm!




回答3:


Drop EF table __MigrationHistory, assuming you were just playing with migrations in test.




回答4:


Install EFTools6.1.3ForVS2012, mine got solved




回答5:


I had the same issue. In my case, for some reason the app config did not have the entity framework section in configSections tag. adding it solved my issue.



来源:https://stackoverflow.com/questions/27687108/could-not-determine-storage-version-entity-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!