System.Data.Entity.Core.MetadataException: 'Schema specified is not valid. Errors: MyModel.ssdl(2,2) : error 0152: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.' This exception was originally thrown at this call stack: [External Code] Entityframework_DB.DbOperations.EmployeeRepository.AddEmployee(Entityframework_Models.EmployeeModel) in EmployeeRepository.cs Entityframework_in_mvc.Controllers.HomeController.Create(Entityframework_Models.EmployeeModel) in HomeController.cs [External Code]

 

System.Data.Entity.Core.MetadataException: 'Schema specified is not valid. Errors: 

MyModel.ssdl(2,2) : error 0152: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.'

This exception was originally thrown at this call stack:

[External Code]    Entityframework_DB.DbOperations.EmployeeRepository.AddEmployee(Entityframework_Models.EmployeeModel) in EmployeeRepository.cs

 Entityframework_in_mvc.Controllers.HomeController.Create(Entityframework_Models.EmployeeModel)  in HomeController.cs

[External Code]



Answer :


First Step = Right Click your Solution or Project root and click Manage NuGet Packages. Select 'EntityFramework', select the appropriate Projects and click Ok.


Second Second = Tools -> Library Package Manager -> Package Manager Console and run Install-Package EntityFramework



0 Comments