Problems with the Entity Framework not loading in Windows Service projects

Source: Internet
Author: User
Tags file copy

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.