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.