Publishing system with Entity Framework 6

Asked

Viewed 88 times

0

There is an executable installer for Entity Framework 6 for servers.

I posted the system to a Windows server 2008, and it’s not working. Is returning the following error:

Schema specified is not Valid. Errors: Context.ControleHorasContext.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.

I already checked the connection data in Webconfig, and it’s all correct.

<add name="Entities"     connectionString="metadata=res://*/Context.ControleHorasContext.csdl|res://*/Con text.ControleHorasContext.ssdl|res://*/Context.ControleHorasContext.msl;provider =System.Data.SqlClient;provider connection string=&quot;data  source=VMCPT100;initial catalog=ControleHoras;persist security info=True;user  id=*;password=*;MultipleActiveResultSets=True;App=EntityFramewo rk&quot;" providerName="System.Data.EntityClient" /> 

I also checked the bin folder, and made sure that the Entityframework.dll file is there.

  • Looking for the bug on the Internet has a lot of stuff. See if something here can help you

  • @Otavio, this is not related to the Server. The problem is in your application. It could provide more details of how your class is DBContext ?

  • Check your Controlehorascontext class if there is no decoration error, post the class code for more details.

  • @Renancarlos, I don’t know what the relationship also with mvc ...

  • @Otaviocamargo user id=controleHoras;password=cpt123, Careful what you put here.

  • Check that the Sqlclient . dll is referenced in the project.

  • Take a look at this answer: http://answall.com/a/168852/61561 this might solve the problem with Provider

Show 2 more comments

1 answer

-1

I have already managed to resolve this issue by fixing the installation of the Entity framework.

My solution has two projects: one for the MVC site, and the other for data access.

The problem was occurring because I installed Entity framewokr by nuget only for the data access project, where it is effectively used.

This works perfectly in the local environment.

But when generating the package for publication, he complained that the Entity framework was not installed properly.

The solution was to install the Entity framework on Solution (all projects).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.