Could not determine storage version error, EF 6 co

2019-07-25 00:12发布

问题:

I'm using EF code first approach in MVC and my web.config's connection string looks like-

<connectionStrings>
    <add name="SchoolContext" connectionString="XYZ-server;integrated security=True;" providerName="System.Data.SqlClient"/>
</connectionStrings>

And I'm getting following error-

Server Error in '/' Application.

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

I also checked duplicates but none of them worked in my case- Duplicate question1 Duplicate question2

回答1:

I solved the issue by looking closely to the connection string, actually data source was missing, correct one is-

<add name="SchoolContext" connectionString="Data Source=XYZ-server;integrated security=True;" providerName="System.Data.SqlClient"/>