CoreLab.MySql assembly error

Posts   
 
    
braidiano
User
Posts: 40
Joined: 18-Nov-2006
# Posted on: 07-Nov-2007 23:53:53   

Hi,

My Scenario: LLBLGen Pro 2.5 (2.5.07.0831) Adapter CoreLab 4.25.21.0 (licensed, not trial) Asp.Net Web Applcation

I have the following exception in my web app:

Could not load file or assembly 'CoreLab.MySql, Version=4.0.9.0, Culture=neutral, PublicKeyToken=09af7300eec23701' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

this is the stack trace:


[FileLoadException: Could not load file or assembly 'CoreLab.MySql, Version=4.0.9.0, Culture=neutral, PublicKeyToken=09af7300eec23701' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
   SD.LLBLGen.Pro.DQE.MySql.DynamicQueryEngine.CreateCommand() +0
   SD.LLBLGen.Pro.DQE.MySql.DynamicQueryEngine.CreateSelectDQ(IEntityFieldCore[] selectList, IFieldPersistenceInfo[] fieldsPersistenceInfo, IDbConnection connectionToUse, IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause, Boolean relationsSpecified, Boolean sortClausesSpecified) +69
   SD.LLBLGen.Pro.ORMSupportClasses.DynamicQueryEngineBase.CreateSelectDQ(IEntityFieldCore[] selectList, IFieldPersistenceInfo[] fieldsPersistenceInfo, IDbConnection connectionToUse, IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause) +505
   SD.LLBLGen.Pro.DQE.MySql.DynamicQueryEngine.CreatePagingSelectDQ(IEntityFieldCore[] selectList, IFieldPersistenceInfo[] fieldsPersistenceInfo, IDbConnection connectionToUse, IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize) +151
   SD.LLBLGen.Pro.ORMSupportClasses.DynamicQueryEngineBase.CreateSelectDQ(IEntityFieldCore[] selectList, IFieldPersistenceInfo[] fieldsPersistenceInfo, IDbConnection connectionToUse, IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize) +42
   SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.CreateSelectDQ(IEntityFields2 fieldsToFetch, IFieldPersistenceInfo[] persistenceInfoObjects, IPredicateExpression filter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize) +106
   SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollectionInternal(IEntityCollection2 collectionToFill, IRelationPredicateBucket& filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize) +806
   SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollection(IEntityCollection2 collectionToFill, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPrefetchPath2 prefetchPath, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize) +117
   SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollection(IEntityCollection2 collectionToFill, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPrefetchPath2 prefetchPath, Int32 pageNumber, Int32 pageSize) +30
   SD.LLBLGen.Pro.ORMSupportClasses.LLBLGenProDataSourceView2.ExecuteSelectEntityCollection(Int32 pageSize, Int32 pageNumber, DataSourceSelectArguments arguments) +367
   SD.LLBLGen.Pro.ORMSupportClasses.LLBLGenProDataSourceView2.ExecuteSelect(DataSourceSelectArguments arguments) +136
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
   DevExpress.Web.ASPxClasses.ASPxDataWebControl.PerformSelect() +198
   DevExpress.Web.ASPxGridView.ASPxGridView.PerformSelect() +70
   DevExpress.Web.ASPxClasses.ASPxDataWebControlBase.DataBind() +68
   DevExpress.Web.ASPxClasses.ASPxDataWebControlBase.EnsureDataBound(Boolean ensureChildControls) +100
   DevExpress.Web.ASPxClasses.ASPxDataWebControlBase.OnPreRender(EventArgs e) +18
   System.Web.UI.Control.PreRenderRecursiveInternal() +77
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360

I added in my web.config:

 <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="CoreLab.MySql" culture="neutral"/>
      <bindingRedirect oldVersion="4.0.9.0" PublicKeyToken="09af7300eec23701" newVersion="4.25.21.0"/>
    </dependentAssembly>
  </assemblyBinding>

but it doesn't help rage

**The application WORKS if I execute it on localhost ** (i haven't got 4.0.9.0 in GAC), but if i deploy it on a remote web server, it returns the exception

Can anyone help me? Thanks!

P.S.: In DBSpecific Project i referenced CoreLab.MySql 4.25.21.0, and if i execute solution with with visual studio's web server i can see:


'WebDev.WebServer.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\CoreLab.Data\4.25.17.0__09af7300eec23701\CoreLab.Data.dll', No symbols loaded.
'WebDev.WebServer.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\CoreLab.MySql\4.25.21.0__09af7300eec23701\CoreLab.MySql.dll', No symbols loaded.


Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 08-Nov-2007 11:03:45   

'WebDev.WebServer.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\CoreLab.Data\4.25.17.0__09af7300eec23701\CoreLab.Data.dll', No symbols loaded.

You might need to add a redirect for Corelab.Data as well.

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="CoreLab.MySql" culture="neutral"/> <bindingRedirect oldVersion="4.0.9.0" PublicKeyToken="09af7300eec23701" newVersion="4.25.21.0"/> </dependentAssembly> </assemblyBinding>

but it doesn't help

The application WORKS if I execute it on localhost (i haven't got 4.0.9.0 in GAC), but if i deploy it on a remote web server, it returns the exception

But in the localhost you have 4.25.21.0 in the GAC, right? What about in the remote server?

braidiano
User
Posts: 40
Joined: 18-Nov-2006
# Posted on: 08-Nov-2007 11:22:24   

Thanks Walaa,

You might need to add a redirect for Corelab.Data as well.

i added it too, but doesn't help.

But in the localhost you have 4.25.21.0 in the GAC, right? What about in the remote server?

yes, on localhost i have it in the GAC. In the remote server there aren't in the GAC. I deployed CoreLab.MySql and CoreLab.Data in the bin.

[EDIT]

i think that is an issue of LLBLGen, because if i try to deploy a project that do not use LLBLGen, but uses directly CoreLab classes, it works without the binding redirect of assemblies. It seems like that there is in LLBLGen's MySql.DQE a reference to 4.0.9.0 (i read that is built against 4.0.9.0, right?)...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 08-Nov-2007 11:59:51   

Yes that's build against 4.0.9.0. Core Lab should provide a policy file, we can't release a new build every time they release a new version, because then everyone has to upgrade as well, which is of course impossible.

Your application needs to have assembly redirections, and if they don't work, they're likely not specified properly. To find out which assembly exactly wasn't loadable (as the exception simply says that Corelab.MySql isn't loadable, but that could be because a related assembly wasn't loadable) you have to use the fuslogvw.exe tool, located in the .NET installation bin folder.

With that tool, you can find out which assemblies weren't found.

Frans Bouma | Lead developer LLBLGen Pro
rdhatch
User
Posts: 198
Joined: 03-Nov-2007
# Posted on: 24-May-2008 19:28:57   

Below is the best solution.

This solution is one-size fits all (you don't need to run the assembly log viewer)... because you don't have to know what CoreLab versions your LLBLGen build references. It redirects ALL CoreLab calls to your CoreLab DLLs - which can simply be in your /bin folder on a web server, without anything else needing to be installed or placed within the GAC.

1.) In your web.config - Make sure your configuration tag looks like: <configuration> NOT <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

2.) Place the following within your web.config's <configuration> tag

Ryan D. Hatch

<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="CoreLab.MySql" publicKeyToken="09af7300eec23701" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.50.27.0"/> </dependentAssembly>

  <dependentAssembly>
    <assemblyIdentity name="CoreLab.Data" publicKeyToken="09af7300eec23701" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.50.21.0"/>
  </dependentAssembly>

</assemblyBinding>

</runtime>