Strange 'Set EntityFactory to use' errors

Posts   
 
    
Markiemac
User
Posts: 132
Joined: 25-Apr-2006
# Posted on: 05-Feb-2007 21:59:51   

Hi,

Have returned to using LLBLGenPro V2, VB, Adapter, VS2005 SP1 and SQL Server to test some concepts. On my Form is an EntityCollection, BindingSource & DataGridView. Database is Northwind, Datasource is Orders on which is mapped a related field from the Customer table.

When I try to select the 'Entity factory to select' I get the following:

Error invoking 'Set EntityFactory to use'. Details: Unable to cast object of type 'NW.Sales.DAL.HelperClasses.EntityCollection' to type 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection2'

However, if I Clean then Rebuild the project, I can set the factory. Now when I start Debugging the following error is generated:

Code generation for property 'Set EntityFactory to use' failed. Error was: "EntityFactory2Converter' is unable to convert 'NW.Sales.DAL.FactoryClasses.OrdersEntityFactory' to 'System.ComponentModel.Design.Serialization.InstanceDescriptor'.'

If I then Ok the error the project will run.

This problem only manifested itself after I mapped the related field and re-generated the project.

  1. Could it be that I have some sort of a Referencing problem? What thoughts anyone?

  2. I'm not able to edit data in the grid. Is this because Orders has a related field mapped to it?

I'd appreciate any feedback on this. Thanks

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 06-Feb-2007 02:16:04   

If you remove the related field and regenerate does the error still occur?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 06-Feb-2007 10:56:47   

Be sure you have referenced the same ORMSupportClasses dll in every project.

Frans Bouma | Lead developer LLBLGen Pro
Markiemac
User
Posts: 132
Joined: 25-Apr-2006
# Posted on: 06-Feb-2007 13:50:05   

Hi,

Restarted today, where I left off and found no errors at all.

otis wrote:

Be sure you have referenced the same ORMSupportClasses dll in every project.

I checked, all was Ok

bclubb wrote:

If you remove the related field and regenerate does the error still occur?

Removed the related field, and using a new Form, Rebuilt and Debugged = No errors

Then remapped the related field, rebuilt the DAL project Opened the solution, and using the new Form tried to 'Set EntityFactory to use' Error generated as described in first post.

So unloaded VS2005, rebuilt entire solution (not just the DAL project) Successfully selected: 'Set EntityFactory to use' Included related field in my grid then Debugged successfully

Yesterday I noticed another post on this matter and Cleaning & Rebuilding seemed to be the only solution. Must be VS getting itself twisted.

Any other comments welcomed then close this please.

Thanks guys