The Windows Service project referenced another class library project, and the other project used the Entity Framework (introduced through NuGet), but my Windows service couldn't be turned on, so I modified App. config to join EF Configuration information can be turned on, but the business code cannot be entered and errors are found through the log:
System.InvalidOperationException:The Entity Framework provider type ' System.Data.Entity.SqlServer.SqlProviderServices, Entityframework.sqlserver ' registered in the application config file for the ADO provider with invariant name ' System.Data.SqlClient ' could not being loaded. Make sure, the assembly-qualified name is used and that the assembly are available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
The meaning is sqlproviderservices, Entityframework.sqlserver already registered to the App. Config, but can not load correctly, should be a DLL not introduced, direct contrast bin/ Release directory, found that compared with other normal projects less a EntityFramework.SqlServer.dll, the file copy into, Gaocheng!
Similarly, if I am using the EF + MYSQL database, I want to ensure that the bin/release under the MySql.Data.Entity.EF6.dll, build the project and publish the site, the two DLLs will not be produced together.
Problems with the Entity Framework not loading in Windows Service projects