Is it possible to work directly with EntityFramework sources?

4

Is it possible to work directly with Entity Framework and debug sources within your classes and methods?

>

I downloaded the zip code from it contained in CodePlex . I unpacked it into a folder and in my project I added the project directly:

  

.. \ EntityFramework \ src \ EntityFramework \ EntityFramework.csproj

Compilation does not report any errors. But running my application displays the following error message:

  

Could not load file or assembly 'EntityFramework' or one of its dependencies. Unable to verify strong name signature. The assembly may have been violated or overdue but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)

Let's say it's for didactics, to further test how it handles some tasks.

If it is possible and this error message is due to something wrong I did or something I stopped doing, what should I do then and how to prepare my application to work directly with the Entity Framework ?

If it is possible and you do this commonly, then how can I organize my project more simply to work with it directly from the sources?

EDITION

As indicated by @Cigano, I'm trying with the repository sources in Github:

  

link

However, I'm getting several error messages:

  

Package references not found. Run 'build initialize' before opening solution for first time.

What is he asking of me? How to do it?

    
asked by anonymous 27.08.2014 / 23:07

2 answers

5

Using Nightly Builds

You can also work with the daily version releases made by Micosoft, but they are bundled and I do not know if the DLLs of these packages have Debug information. Anyway, I think it's possible to mix this method with the method below.

Use the following link to step-by-step the EF7 configuration in your application using night packets: link

Roadmap for installing and using the Entity Framework from sources

What I should teach here is to compile the Entity Framework 7, which on the date of this response is the beta release provided in GitHub.

1. Download the fonts

In this step I assume you have at least one GitHub account and have notions on how to use it.

Using GitHub for Windows , clone the following repository on your machine:

  

link

2. Initialize your copy

Go to the root of the EntityFramework directory downloaded by your GitHub, open a command prompt (in Windows Explorer, hold Shift and right click on the directory, then choose < Open Command Window Here , and type:

build initialize

NuGet will be invoked and the project dependencies will be installed automatically. The window will look something like this:

3.Openandcompiletheproject

Theprojectopensin Visual Studio 2013 with Update 2 . Open the project, just compile the project EntityFramework.SqlServer :

4. Replace the Packages DLLs

For the test, I added all the compiled files that were within src/EntityFramework.SqlServer/bin/Debug into the packages/EntityFramework-<versão>/lib/net45 directory. You may need to remove the old references in the project before replacing these files.

    
27.08.2014 / 23:08
4
The Entity Framework contained in GitHub is version 7, whereas that installed in applications NuGet is version 6.1, as tested in VS 2013, it is still CodePlex .

According to information in the EF 7 Wiki, in GitHub:

  
  • Data Annotations are not supported for configuring a model.
  •   
  • The Fluent API only has very basic functionality implemented so far. For many modeling concerns (such as defining relationships between entities) you need to manipulate the underlying object model directly.
  •   

Dregs are not yet supported and the Fluent API is in a very basic version.

In my tests, adding reference to the EntityFramework , EntityFramework.SqlServer and Migrate It was already possible to compile and run the project without errors. I was able to debug by methods.

Comment : In these tests I did not copy the folders of these projects into mine, I added the projects to my solution by looking for them directly from the folder where I unzipped the Entity Framework .

Since it is for a didactical question and to further test how EF is working with my model, the version contained in NuGet is currently more interesting to me.

    
28.08.2014 / 16:53