ErikEJ / EntityFramework6PowerTools

This is the codebase for Entity Framework 6 Power Tools Community Edition, and modern EF 6 providers for SQL Server and SQL Server Compact
Other
183 stars 27 forks source link

ADO.NET Provider Microsoft.Data.SqlClient Not Registered #114

Closed KnechtLRK closed 1 year ago

KnechtLRK commented 1 year ago

I installed the latest package of ErikEJ.EntityFramework.SqlServer. Upon compiling the project which consists only of the database models I'm getting the following error reported against the .edmx file.

Error 175: The ADO.NET provider with invariant name 'Microsoft.Data.SqlClient' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details.

I followed the instructions in the ReadMe section so I'm at a lost of where to go from here. The error is being reported at line 7 of the .edmx file (see below).

<Schema Namespace="HobartService.Common.Models.Store" Provider="Microsoft.Data.SqlClient" ProviderManifestToken="2012.Azure" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">

Here are .edmx, app.config, and packages.config files. B2B.edmx.txt App.Config.txt packages.config.txt

Any insight on the resolution would be greatly appreciated. Thank you!

ErikEJ commented 1 year ago

Please share a simple runnable console app

KnechtLRK commented 1 year ago

I ended up getting this working. The situation was we have a separate project for the entity framework models which is a class library. It was this project that was reporting the error. After adding the ErikEj.EntityFramework.SqlServer package to the console application the console application does not have the same build error and even though the class library still reports the build error the application does run successfully.