Print Page | Close Window

Entity Server Exception

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4321
Printed Date: 06-Sep-2025 at 6:51am


Topic: Entity Server Exception
Posted By: energysaver
Subject: Entity Server Exception
Date Posted: 16-Sep-2013 at 10:06am
Hello,

I have a DevForce Universal subscription. I'm getting the "Entity Server Exception" below when I attempt to execute a query using an entity manager. This is the logic that throws the exception:

 _entityManager = New ProposalContext() With {.AuthenticationContext = Await Authenticator.Instance.LoginAsync(Nothing)}
  Dim qry = _entityManager.tblCustomers.Where(Function(c) c.State = "WA").
            Select(Function(c) New With {c.CustomerName, .City = c.City, .State = c.State})
  Dim results = Await qry.ExecuteAsync

The exception throws on the last line -- on the call to qry.ExecuteAsync.

I noticed that every single table EntityQuery in the context throws this exception when I expand its "EntityGroup" property in the debugger:

{System.ArgumentException: Unable to get metadata for  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.EntityManager.CreateEntityGroupAndInitialize(Type entityType)
   at IdeaBlade.EntityModel.EntityManager.GetEntityGroup(Type entityType)
   at IdeaBlade.EntityModel.EntityQuery.get_EntityGroup()}

I had all of this working the last time that I tried using DevForce in this project. Since then, I have migrated to a new machine and reinstalled everything. I just tried uninstalling all DevForce and related NuGet packages for my solution and then reinstalling everything, but it didn't help.

Suggestions?

Thanks in advance,

Danny

IdeaBlade.EntityModel.EntityServerException was caught
  Cancelled=False
  Message=Type 'IdeaBlade.EntityModel.EntityQueryProxy`1[[TWT.DataServices.Proposal.tblCustomer, TWT.DataServices.Proposal.SL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' is not known to the serializer. The following probe assemblies were found during initialization: TWT.Common.SL, TWT.DataServices.Core.SL, TWT.DataServices.Orchard.SL.  Make sure that the assemblies holding your entity model and other known types are in this list.  Check that your CompositionHost.SearchPatterns are correct.  Also see the debug log to check for assembly load errors.
  StackTrace:
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
       at CatalystProposalWeb.MainPage.VB$StateMachine_1_LoginToEntityServer.MoveNext()
  InnerException: System.Runtime.Serialization.SerializationException
       Message=Type 'IdeaBlade.EntityModel.EntityQueryProxy`1[[TWT.DataServices.Proposal.tblCustomer, TWT.DataServices.Proposal.SL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' with data contract name 'EntityQueryProxyOftblCustomerfijcA7A0:http://ideablade.com/EntityModel' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.
       StackTrace:
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
            at WriteConstantExpressionBlockToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )
            at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
            at WriteArrayOfExpressionBlockToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , CollectionDataContract )
            at System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
            at WriteMethodCallExpressionBlockToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )
            at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
            at WriteArrayOfExpressionBlockToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , CollectionDataContract )
            at System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
            at WriteMethodCallExpressionBlockToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )
            at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
            at WriteSerializedExpressionToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )
            at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
            at WriteEntityQuerySurrogateToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )
            at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiTypeAtTopLevel(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle originalDeclaredTypeHandle)
            at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph)
            at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph)
            at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph)
            at System.Runtime.Serialization.XmlObjectSerializer.WriteObject(XmlDictionaryWriter writer, Object graph)
            at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameterPart(XmlDictionaryWriter writer, PartInfo part, Object graph)
       InnerException:




Replies:
Posted By: kimj
Date Posted: 16-Sep-2013 at 3:00pm
These are odd problems.  Make sure that you're using the same version of DevForce in all your projects and referenced assemblies.  Also do a "clean" and then build.  If not resolved, can you tell me the version of DevForce 2012 you're using, and whether you have DevForce 2010 installed too.


Posted By: energysaver
Date Posted: 17-Sep-2013 at 5:19am
I don't have 2010 installed -- I have 2012 v7.2.1.0 installed, only. I did a "clean" and build a number of times already with the same result.


Posted By: kimj
Date Posted: 17-Sep-2013 at 8:01am
OK.  If you can zip up your solution and send it to us, that may be the quickest way to resolve this.  You can upload it, or email to IdeaBladeSupportTrack.


Posted By: energysaver
Date Posted: 23-Sep-2013 at 10:23am
Thanks for offering to review my solution, but I figured out the problem. I was missing a composition search pattern in the SelectAssemblies method of my bootstrapper for the DLL containing the model that I was trying to query.


Posted By: kimj
Date Posted: 23-Sep-2013 at 10:27am

Glad you resolved the problem, and thanks for posting the solution!




Print Page | Close Window