Something wrong with references using two layers in the Entity

1

I made an example in Entity 5.0 and with 1 layer worked perfect.

Now I have separated in UI and DA L, but this is giving error. The same page that worked on the DAL layer when done in UI is giving error. I think it's a lack of reference.

The error is:

Server Error in '/' Application.

Unable to load the specified metadata resource.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.MetadataException: Unable to load the specified metadata resource.

Source Error: 

Line 41:    using (var ctx = new DAL.TracesEntities())
Line 42:    {
Line 43:        var lambda = ctx.Traces.Where(q => q.DataBaseName == "megacorretor" || q.DataBaseName == "stats_mega")
Line 44:                               .GroupBy(a => new { a.TextData, a.DataBaseName })
Line 45:                               .Select(b => new { ...

I made reference to the DAL project and the DLL:

packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll

I do not remember if I should copy some .tt something to UI to work. Strange that interlisense in UI works perfectly with entity of DAL

    
asked by anonymous 20.03.2014 / 18:10

1 answer

2

This error means that resource (refers to EDMX) has not been found. It is in this EDMX file that the metadata used to map your class model to the database model is saved.

Make sure that in the designer of your EDMX file, the MetadataArtifactProcessing property is set to Embed in Output Assembly ... this is what makes EDMX transform into resource . >     

21.03.2014 / 00:36