New Posts New Posts RSS Feed: Weird Code First Devforce Error
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Weird Code First Devforce Error

 Post Reply Post Reply
Author
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Topic: Weird Code First Devforce Error
    Posted: 19-Oct-2012 at 12:34pm
Hi Von,
 
The iRely.Reports.Model assembly needs to be "enhanced" by PostSharp.  I see that the iRely.BaseModel assembly contains PostSharp enhancements, but the other assembly does not.  I know that the iRely.Reports.Model project does reference the PostSharp assembly and I don't see any settings which indicate PostSharp processing was skipped, but the assembly definitely does not contain the necessary PostSharp changes.   Rebuild the project, and check the build output window for diagnostics.
 
We agree that the errors you'll find with Code First development are often quite inscrutable, and we're trying to fix that.
 
 
Back to Top
Vonzkie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01-Aug-2011
Location: PH
Posts: 133
Post Options Post Options   Quote Vonzkie Quote  Post ReplyReply Direct Link To This Post Posted: 18-Oct-2012 at 8:06pm

Here's the link of my Model Project
uploads/1228/For_Devforce_Checking.rar

After having hard time making this work with some unusual error such as "Key 'iRelyReportsEntities_Example' object reference.....' when performing query, we eliminate the error by just doing the relationship via Fluent API.

Now, the problem is, when trying a query "Object Ref is still showing but without the Key part"
I noticed that the problem occurs in the client side unlike the first one w/c occurs in the server side..

Here's the stack trace of the error:

  at IdeaBlade.EntityModel.EntityProperty.GetValueRaw(IStructuralObject so)
   at IdeaBlade.EntityModel.EntityAspect.GetValueRaw(DataEntityProperty property, EntityVersion version)
   at IdeaBlade.EntityModel.EntityAspect.<GetValuesRaw>b__17(DataEntityProperty p)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at IdeaBlade.EntityModel.EntityAspect.GetValuesRaw(IEnumerable`1 properties)
   at IdeaBlade.EntityModel.EntityAspect.get_EntityKey()
   at IdeaBlade.EntityModel.EntityGroup.LoadEntity(EntityAspect sourceAspect, MergeStrategy mergeStrategy, Boolean& rowUpdated)
   at IdeaBlade.EntityModel.EntityMerger.MergeEntityCore(EntityAspect sourceAspect, EntityGroup targetEntityGroup)
   at IdeaBlade.EntityModel.EntityMerger.MergeEntity(EntityAspect sourceAspect, EntityGroup targetEntityGroup, NavigationContext context)
   at IdeaBlade.EntityModel.EntityMerger.<>c__DisplayClass9.<MergeEntities>b__8(EntityAspect sourceAspect)
   at System.Linq.Enumerable.<>c__DisplayClass12`3.<CombineSelectors>b__11(TSource x)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at IdeaBlade.Core.EnumerableFns.ForEach[T](IEnumerable`1 items, Action`1 action)
   at IdeaBlade.EntityModel.DataBlockFns.MakeResultList(Type type, IEnumerable items, Boolean isOrdered)
   at IdeaBlade.EntityModel.EntityQueryResult.UpdateDataSet(EntitiesDataBlock block, NavigationContext context)
   at IdeaBlade.EntityModel.EntitiesDataBlock.Resolve(EntityQueryResult helper)
   at IdeaBlade.EntityModel.EntityQueryResultCollection..ctor(DataQueryResultCollection dqResults, EntityManager entityManager, MergeStrategy mergeStrategy)
   at IdeaBlade.EntityModel.EntityManager.MergeAndReturnUsingCache(IEntityFinder finder, DataQueryResultCollection dqResults)
   at IdeaBlade.EntityModel.EntityManager.ProcessFetchedData(DataQueryResultCollection dqResults, IEntityFinder finder)
   at IdeaBlade.EntityModel.EntityManager.ExecuteFetch(IEntityFinder finder)
   at IdeaBlade.EntityModel.EntityQueryFinder.Execute()
   at IdeaBlade.EntityModel.EntityManager.ExecuteQueryCore(IEntityQuery query, Boolean isAsync)
   at IdeaBlade.EntityModel.EntityManager.ExecuteQuery[T](IEntityQuery`1 query)
   at IdeaBlade.EntityModel.EntityQueryExtensions.Execute[T](IEntityQuery`1 query)
   at IdeaBlade.EntityModel.EntityQuery`1.GetEnumerator()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at TestProject.Program.Main(String[] args) in D:\NEW TFS 2\iRely Suite\Development Work\iRely Suite Report\TestProject\Program.cs:line 70
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

I just wonder why it's so complicated using the Devforce Code First over to Database First?
It's just frustrating to have these errors that we didn't experience before we're on Database First.
Not to mention that there are no "user friendly message" when an error occurs.
I hope this can be improved.

Thanks,
Von
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down