New Posts New Posts RSS Feed: Unable to get metadata error
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Unable to get metadata error

 Post Reply Post Reply
Author
JohnBloom View Drop Down
Groupie
Groupie
Avatar

Joined: 30-Nov-2010
Location: Topeka, KS
Posts: 95
Post Options Post Options   Quote JohnBloom Quote  Post ReplyReply Direct Link To This Post Topic: Unable to get metadata error
    Posted: 02-Apr-2014 at 1:38pm
We have been having some pretty strange behavior and I am really at a loss to explain it. Here is the back story.

I was updating the Newtonsoft library via nuget. I did some other things and ran the product. It crashed with the error below. This is a WPF app we can run instead of running our windows services:

Service cannot be started. System.ArgumentException: Unable to get metadata for CoreDB.BaseKalosPoco. Make sure it is a valid entity type or POCO type with a KeyAttribute
   at IdeaBlade.EntityModel.EntityMetadataStore.GetEntityMetadata(Type entityType, Boolean canThrowException)
   at IdeaBlade.EntityModel.EntityMetadata.IsMappedEntityType(Type t)
   at IdeaBlade.EntityModel.EntityMetadata.HasAnyConcreteEntityBaseTypes(Type type)
   at IdeaBlade.EntityModel.EntityQuery.get_Expression()
   at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
   at DomainServices.InterfaceServerRepository.GetInterfaces(String instanceName)
   at PPO.Service.Core.KalosServiceWorker.StartInstalledInterfaces(String instanceName, IEventAggregator eventAggregator)
   at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)

This happens on the first query that is run. I went through all of my changes but reversing them one by one and this lead me to Newtonsoft. Indeed updating from version 4.5.11 to the current version causes this error. Since our devforce version was behind I updated it to see if the problem was fixed. After updating all of the libraries I was able to run the application with no errors. 

So I created an installer and ran it on our test server and the service crashed with the error. So now I am in an even worse spot because the error is only reproducible in the wild.

The object that it is complaining about is the base class that is injected into entities. I also have this line in the bootstrapper:

IdeaBlade.Core.Composition.CompositionHost.IgnorePatterns.Add("Newtonsoft.*");
I really have no idea why Newtonsoft is blowing up our application. 
Any ideas? Let me know if I can provide any more information.
-John Bloom
Back to Top
jbiddle61 View Drop Down
Newbie
Newbie


Joined: 18-Dec-2012
Location: Arizona
Posts: 24
Post Options Post Options   Quote jbiddle61 Quote  Post ReplyReply Direct Link To This Post Posted: 02-Apr-2014 at 4:22pm
If your NuGet updates also updated Entity Framework from 6.0.2 to 6.1, you are having the same problem I am (see prior thread).  I've been waiting for over a week for a response from IdeaBlade support, but nothing yet.  To work around the problem, I had to revert EF back to 6.0.2 by using NuGet to remove all packages that refer to EF and then EF itself.  Then use the NuGet console to get version 6.0.2 of EF and re-add the other packages you had to remove.  Big paid in the A$$ I know, but that is the only way I was able to get my model projects building again.

         John
Back to Top
JohnBloom View Drop Down
Groupie
Groupie
Avatar

Joined: 30-Nov-2010
Location: Topeka, KS
Posts: 95
Post Options Post Options   Quote JohnBloom Quote  Post ReplyReply Direct Link To This Post Posted: 03-Apr-2014 at 6:39am
My error is happening during run time and not during compile. I am also not using code first, so I dont think we are having the same issue

Thanks for the comment though as it does seem like Ideablade is switching gears and it is hard to get the same day response that we are used to. I might actually try updating EF and see it that fixes my issue. 

Hope you can get your issues resolved

John
-John Bloom
Back to Top
JohnBloom View Drop Down
Groupie
Groupie
Avatar

Joined: 30-Nov-2010
Location: Topeka, KS
Posts: 95
Post Options Post Options   Quote JohnBloom Quote  Post ReplyReply Direct Link To This Post Posted: 03-Apr-2014 at 9:31am
Ok I figured out my problem. It turns out that the Nuget package updated the dlls but didnt update the reference. So It looked like it was using Newtonsoft 6 but the reference still said 4.5. 

As a side benefit we are now on the latest Devforce, Cocktail, Newtonsoft, and EntityFramework. :)
-John Bloom
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down