Sharing the Entity Framework in multiple projects

We have an Entity Framework project with several models created using .NET 4 and VS2010. Then we have several projects that should use this entity project. We have successfully compiled the EF project into a DLL. We have also successfully added the EF dll link to several projects that work great.

The problem is that we have several programs (ASP.NET and console applications) that reference this EF-dll, and the DLL is copied locally for each calling program, when we make changes to the EF DLL, then we must go to each project and replace the EF dll with the new assembly.

I searched a lot for sharing libraries and even EF projects in several projects. Although I found several, I can’t find a good example that I can do work for my situation, or it’s not so old that it doesn’t matter.

This is a general question that I have. To better understand the problems that I am facing, I will focus on one specific project. This is an ASP.NET intranet web project. If we add an EF dll link and let the project copy the DLL locally, EF works fantastically. However, since we have several projects, we need to try and centralize the EF dll somewhere where it can be used by several processes. I am not trying to configure this so that one EF library is accessible across multiple servers. I am happy to install a copy of the DLL on separate servers, if necessary.

My desire is to create a directory of "shared libraries" on each server, a simplified example of "C: \ OurLibraries". Then we placed in this folder or EF dll (and, possibly, others later), and allowed various programs / processes to access the shared copy of the EF DLL. I made sure that the "local copy" of the EF library was removed from the intranet project and a link was added to the file "C: \ OurLibraries \ OurEF.dll". Everything builds fine, and the intranet project works fine until it tries to display a page with EF links and then displays an error message:

"Failed to load EntityNS.ProductDBEntity."

If I include a “local copy” in the link, the intranet site works fine again. I can't seem to find this magical setting that will allow me to share the EF file.

, , :

  • GAC. , "C:\OurLibraries"

  • "C:\OurLibraries" PATH.

  • EF web.config , "OR" : /Ecomedate.csdl | :///Ecomedate.ssdl | :///Ecomedate.msl; = System... ; = System...

( : Entity ?)

. , , DLL , , , .

, , .

GAC. - VS2010 gacutil C:\Program Files\Microsoft SDK... " gacutil" , gacutil dev . Gacutil Server 2008 .Net 4, , DLL GAC

  • , , gacutil, psexec gacutil . psexec gacutil prod- 0, , , , gacutil prod- someting like gacutil/l DataEntity.dll DLL... .
  • gacutil.exe gacutil.exe.config , . gacutil, , gacutil.exe/i DataEntity.dll gacutil.exe/l DataEntity. gacutil .
  • - Microsoft SDK prod. , , - , SDK .
  • , Remote GAC Manager, , - 2008 , , GAC, c:\Windows\assembly gac dll, .NET 4 C:\windows\Microsoft.NET\ DLL GAC, DLL gac. dir DataEntity.dll/s c:\windows , DLL, C:\Windows\Microsoft.NET\assembly\GAC_MSIL, C:\Windows\Microsoft.NET\assembly\GAC_MSIL, DLL, , (, , ) DLL C:\Windows\Microsoft.NET\assembly\GAC_MSIL 2008.
  • dll gac drag and drop. , . C:\Windows\Microsoft.NET\assembly\GAC_MSIL? , , , / DLL, , .
  • , GAC. . . , dll GAC, DLL gac; , . -, dll, , . , , . , , , IIS, IIS, , , , IIS. , .

, DLL . DataEntity.dll c:\MyLibraries DLL. Microsoft C:\Program Files\Common Files, , , , , , GAC , DLL DLL, .

+5
3

Web Services. .web. WCF, .

+1

GAC, , , . GAC, , GAC.

0

"" , Git , Git DLL ( DLL), / .

0

All Articles