MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Rebuilding the DAL with LLBLGEN causes erros  (Mono Support )

Viewed 46119 time(s), 7 post(s) 7/7/2016 7:25:22 AMby ncole

Related topics

ncole

ncole

7/7/2016 7:26:32 AM
Hi,
 
I have been working with the MonoX project for a few weeks now and have built a custom site using the instructions here:
 
http://monox.mono-software.com/blog/post/Mono/95/Building-a-custom-ASP-NET-project-based-on-MonoX/
 
I'm now at the point where I need to extend some of the Entities so have set  about trying to rebuild the DAL. I have cloned the DAL repository, and have bought a licence for LLBLGen v4.1. I was then able to open the llblgen project in the repository. As a test I decided to simply add a new field to the BlogPost table in my database named 'MonoX2'. I did this through SQL Management Studio then I refreshed my Relational Model Data in the LLBLGen project. This worked fine. I then Generated the source code which also worked fine. I was then able to open the new MonoSoftware.MonoX.DAL project in Visual studio. I fixed the references and rebuilt the DAL dll which also worked fine.... Finally I updated my MonoX web project to reference the new DAL dll.
 
Unfortunately i now get the error below... please advise what this error means??
 

 
Server Error in '/' Application.The prefetch path element at index 0 in the passed in prefetch path for root entity type 58 is meant for root entity type 55 which isn't a subtype of 58. This means that you've added a prefetch path node to a Path of an unrelated entity, for example adding OrderDetailsEntity.PrefetchPathProduct to a prefetch path for CustomerEntity.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.ApplicationException: The prefetch path element at index 0 in the passed in prefetch path for root entity type 58 is meant for root entity type 55 which isn't a subtype of 58. This means that you've added a prefetch path node to a Path of an unrelated entity, for example adding OrderDetailsEntity.PrefetchPathProduct to a prefetch path for CustomerEntity.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace: 

[ApplicationException: The prefetch path element at index 0 in the passed in prefetch path for root entity type 58 is meant for root entity type 55 which isn't a subtype of 58. This means that you've added a prefetch path node to a Path of an unrelated entity, for example adding OrderDetailsEntity.PrefetchPathProduct to a prefetch path for CustomerEntity.]
SD.LLBLGen.Pro.ORMSupportClasses.PrefetchPathFetcher.ProducePathNodeParameters(QueryParameters rootNodeParameters, Int32 nodeIndex, Int32 parameterisedPrefetchPathThreshold, ITransaction transactionToUse) +1717
SD.LLBLGen.Pro.ORMSupportClasses.PrefetchPathFetcher.FetchPrefetchPath(QueryParameters rootNodeParameters, Boolean forceParameterizedPPath, ITransaction transactionToUse, Int32 parameterisedPrefetchPathThreshold, Action`1 fetchNodeFunc, Action`4 mergeManyToManyFunc) +121
SD.LLBLGen.Pro.ORMSupportClasses.PersistenceCore.FetchPrefetchPath(QueryParameters rootNodeParameters, Boolean forceParameterizedPPath, ITransaction transactionToUse, Int32 parameterisedPrefetchPathThreshold, Action`1 fetchNodeFunc, Action`4 mergeManyToManyFunc) +345
SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchAdditionalPrefetchPath(IPrefetchPath2 prefetchPath, Context contextToUse, IEntity2 fetchedEntity, IRelationPredicateBucket filterToUse) +296
SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityUsingFilter(IEntity2 entityToFetch, IPrefetchPath2 prefetchPath, Context contextToUse, IRelationPredicateBucket filter, ExcludeIncludeFieldsList excludedIncludedFields) +1006
SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityUsingUniqueConstraint(IEntity2 entityToFetch, IPredicateExpression uniqueConstraintFilter, IPrefetchPath2 prefetchPath, Context contextToUse, ExcludeIncludeFieldsList excludedIncludedFields) +158
SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityUsingUniqueConstraint(IEntity2 entityToFetch, IPredicateExpression uniqueConstraintFilter, IPrefetchPath2 prefetchPath) +72
MonoSoftware.LLBLGen.Repository.FetchEntityUsingUniqueConstraint(IEntity2 entityToFetch, IPredicateExpression uniqueConstraintFilter, IPrefetchPath2 prefetchPath) +74
MonoSoftware.MonoX.Repositories.PageRepository.GetPage(String url, String language) +467
MonoSoftware.MonoX.Utilities.PageUtility.GetPageProperties(String appRelativeCurrentExecutionFilePath) +257
MonoSoftware.MonoX.BasePage.GetPageProperties() +28
MonoSoftware.MonoX.BasePage.get_PageProperties() +26
MonoSoftware.MonoX.BasePage.OnPreInit(EventArgs e) +60
System.Web.UI.Page.PerformPreInit() +46
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1251

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1073.0
This content has not been rated yet. 
60 Reputation 8 Total posts
khorvat

khorvat

7/7/2016 2:58:07 PM
Hi,

this can happen when you change the structure of LLBLGen object while adding additional relations etc. Can you please let us know in what way did you extend the PageEntity or added some entity that has FK to Page ?

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
ncole

ncole

7/7/2016 4:01:27 PM
Hi khorvat,
 
The Only change I made to the Database ( A fresh install) was  a new field to BlogPost table, this was  a basic nvarchar field. I have tried this with a fresh install of the CMS, DB and DAL project and it still gives me the same error
 

 

This content has not been rated yet. 
60 Reputation 8 Total posts
ncole

ncole

7/7/2016 4:24:59 PM
Also this happens without any changes at all to the DB. so I follow these steps...
 
Install MonoX CMS and DB
 
Move project file into root and rename
 
Clone DAL repository 
- Refresh Relational Model (all default options)
  - Generate Source Code (all default options)
- OPen DAL solution in Visual Studio
- Fix references by pointing at MonoX bin folder dlls
  - Build project to create new DAL dll
 
 
 then in MOnoX project add a reference to DAL dll 
 
the error then occurs

This content has not been rated yet. 
60 Reputation 8 Total posts
ncole

ncole

7/8/2016 10:40:44 AM
After doing the above on a fresh install I can create a new blank .aspx page that inherits from MonoSoftware.MonoX.BasePage and it works fine. But then if I change that page to use one of the MonoX Masterpages it errors.
 
I am using the latest version of MonoX - is there some incompatibility between that and the MonoX DAL project?? 
This content has not been rated yet. 
60 Reputation 8 Total posts
ncole

ncole

7/12/2016 1:15:06 PM
any ideas on this?
This content has not been rated yet. 
60 Reputation 8 Total posts
vzakanj

vzakanj

7/19/2016 2:20:47 PM
Hi ncole, can you tell me what do you mean by
"Fix references by pointing at MonoX bin folder dlls"

What you need to do here is remove the existing MonoX DAL dlls and replace them with your own. You should not use your DAL dlls alongside the original MonoX DAL dlls.

Regards,
Vedran
This content has not been rated yet. 
345 Reputation 61 Total posts