Entity Framework 6.0 -- EntityFramework.SqlServer.dll doesn't get copied to the ...Services.WindowsServiceHost\bin folder (NOT a CF issue)

Jun 23, 2014 at 9:57 PM
I thought I'd post this in case anyone else runs into it. I use the CODE Framework for a WPF project and ran into an odd VS bug. (VS 2013).

When building the project the Services.WindowsServiceHost.dll doesn't get copied to the WindowsServiceHost bin folder. You have to copy it from the data access project.

The error in the Event Viewer is:
The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
Jun 25, 2014 at 10:45 AM

Not sure I quite follow. So you create a windows service host (exe?) and the entity framework provider doesn't get copied? Is it flagged correctly in the references? Maybe it requires a .NET version that is higher than the service host project is set to? We really aren't doing anything special one way or another for EF, so it should not make a difference whether it is used from within CF or otherwise.

Jun 25, 2014 at 3:17 PM
Hiya, Markus! T hanks for replying. It's not a CODE Framework issue (I guess my subject line and post didn't convey that). Sorry for the misunderstanding.

It's seemed to be an Entity Framework 6.0 issue. I found forum references to it, but, you prompted to check my references in the Windows Service Host project, and sure enough the EF references were gone. Whether or not the upgrade to VS 2013 did something funky, or I did, I'll never know.

So, I think I'll stop posting now. :-/