1
I made an example in Entity 5.0
and with 1 layer worked perfect.
Now I’ve separated into UI
and DA
L, but this giving error. The same page that worked in the layer DAL
when made in the UI
is giving error.
I believe it’s some lack of reference.
The mistake 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 referenced the DAL project and the DLL:
packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll
I can’t remember if I should copy any .tt
something for the UI
to work. Strange that the interlisense in UI
works perfectly with the entity
of DAL
did you ever change the namespace of the classes moved? If not changed, that’s why Intellisense still recognizes
– Tafarel Chicotti
I don’t know the answer, but to avoid this kind of error you could use code first. There is a very simple tool that generates the classes for you and leaves the code cleaner than with edmx, is Entity power tools. Have an example of it on my blog http://devrodrigosantos.wordpress.com/2014/03/12/beginning/
– Rodrigo Santos
Yes I changed the namespace, alias I created a new file in the UI but with the same code.. intelisense 100% works but it does not find the resource! I believe that here all develop with several layers for no one gives this error?
– Dorathoto
There was no way to make Code first the database already exists with 20GB of data.
– Dorathoto