ambiguous namespace error

Posts   
 
    
MRamesh
User
Posts: 8
Joined: 01-Apr-2006
# Posted on: 01-Apr-2006 11:02:13   

When I try to compile the generated code which is generated for framework 2, ambiguous namespace complilation error occured. We have table name called "Entity" in our data model. Is there any problem with this name? If so, what should I do? Currently the system is up and running. I can't make the change either in datamodel or in code. Can I do anything in LLBLGenPro project to solve this problem?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 01-Apr-2006 11:52:32   

You get a compile error with the name 'Entity' but you have a system up and running which has an entity with the name 'Entity' ? How could that get compiled if you get errors now?

Could you paste the exact compiler error ? (not all of them, just a couple, like hte first ones in the list, which are the most important).

Often compile errors are caused by the fact you have a field mapped onto a relation named 'Transaction' or similar.

Frans Bouma | Lead developer LLBLGen Pro
MRamesh
User
Posts: 8
Joined: 01-Apr-2006
# Posted on: 01-Apr-2006 13:17:15   

I am at home. So I couldn't paste the code. I will put the code on monday. The current system is working in framework 1.1, so we didn't face any problem. But we migarate into framework 2, we are facing this problem.

MRamesh
User
Posts: 8
Joined: 01-Apr-2006
# Posted on: 03-Apr-2006 09:17:01   

As you asked, this is the part of compilation error.

Error 1 'EntityFields' is an ambiguous reference between 'CDMS.DAL.HelperClasses.EntityFields' and 'SD.LLBLGen.Pro.ORMSupportClasses.EntityFields' D:\Callido\CDMS\Coding\DBComponent\CDMSComponent\CDMS2005\CollectionClasses\ PeergroupfinancialdistortionsCollection.cs 356 4 CDMS.DAL

It is working well in Framework 1.1 and Previous version LLBLGen Pro for version 1.1. We got the error for all tables in db.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 03-Apr-2006 09:32:39   

(chopped the list a bit, so the page isn't resized to a very large width...)

MRamesh wrote:

As you asked, this is the part of compilation error.

Error 1 'EntityFields' is an ambiguous reference between 'CDMS.DAL.HelperClasses.EntityFields' and 'SD.LLBLGen.Pro.ORMSupportClasses.EntityFields' D:\Callido\CDMS\Coding\DBComponent\CDMSComponent\CDMS2005\CollectionClasses\ PeergroupfinancialdistortionsCollection.cs 356 4 CDMS.DAL

It is working well in Framework 1.1 and Previous version LLBLGen Pro for version 1.1. We got the error for all tables in db.

This is due to the fact that in v1.0.2005.1 every entity now has a _entityname_Fields class which allows you to quickly create entityfield objects. For the entity with the name 'Entity', it therefore results in the class 'EntityFields' which is already a class in the ORMSupportclasses.

So you have to rename the entity with name Entity to another name. That, or remove the task which creates the entitynameFields classes from the generator config you're using.

Frans Bouma | Lead developer LLBLGen Pro
MRamesh
User
Posts: 8
Joined: 01-Apr-2006
# Posted on: 03-Apr-2006 09:48:59   

Once again, I pasted the part of the errors. We are facing this problem for all tables not only tabled named "entity". I am using "Self servicing two class scenario" configuration. How do I disable the task which creates entityfields object from the config.

'EntityFields' is an ambiguous reference between 'CDMS.DAL.HelperClasses.EntityFields' and 'SD.LLBLGen.Pro.ORMSupportClasses.EntityFields' 'EntityFields' is an ambiguous reference between 'CDMS.DAL.HelperClasses.EntityFields' and 'SD.LLBLGen.Pro.ORMSupportClasses.EntityFields' No overload for method 'EntityFields' takes '1' arguments Cannot apply indexing with [] to an expression of type 'CDMS.DAL.HelperClasses.EntityFields' Cannot apply indexing with [] to an expression of type 'CDMS.DAL.HelperClasses.EntityFields' Cannot apply indexing with [] to an expression of type 'CDMS.DAL.HelperClasses.EntityFields' The best overloaded method match for 'SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.GetScalar(SD.LLBLGen.Pro.ORMSupportClasses.IEntityFields, SD.LLBLGen.Pro.ORMSupportClasses.ITransaction, SD.LLBLGen.Pro.ORMSupportClasses.IPredicate, SD.LLBLGen.Pro.ORMSupportClasses.IRelationCollection, SD.LLBLGen.Pro.ORMSupportClasses.IGroupByCollection)' has some invalid arguments Argument '1': cannot convert from 'CDMS.DAL.HelperClasses.EntityFields' to 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityFields' 'EntityFields' is an ambiguous reference between 'CDMS.DAL.HelperClasses.EntityFields' and 'SD.LLBLGen.Pro.ORMSupportClasses.EntityFields' 'EntityFields' is an ambiguous reference between 'CDMS.DAL.HelperClasses.EntityFields' and 'SD.LLBLGen.Pro.ORMSupportClasses.EntityFields' No overload for method 'EntityFields' takes '1' arguments Cannot apply indexing with [] to an expression of type 'CDMS.DAL.HelperClasses.EntityFields' Cannot apply indexing with [] to an expression of type 'CDMS.DAL.HelperClasses.EntityFields' Cannot apply indexing with [] to an expression of type 'CDMS.DAL.HelperClasses.EntityFields' The best overloaded method match for 'SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.GetScalar(SD.LLBLGen.Pro.ORMSupportClasses.IEntityFields, SD.LLBLGen.Pro.ORMSupportClasses.ITransaction, SD.LLBLGen.Pro.ORMSupportClasses.IPredicate, SD.LLBLGen.Pro.ORMSupportClasses.IRelationCollection, SD.LLBLGen.Pro.ORMSupportClasses.IGroupByCollection)' has some invalid arguments Argument '1': cannot convert from 'CDMS.DAL.HelperClasses.EntityFields' to 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityFields' 'EntityFields' is an ambiguous reference between 'CDMS.DAL.HelperClasses.EntityFields' and 'SD.LLBLGen.Pro.ORMSupportClasses.EntityFields' 'EntityFields' is an ambiguous reference between 'CDMS.DAL.HelperClasses.EntityFields' and 'SD.LLBLGen.Pro.ORMSupportClasses.EntityFields' No overload for method 'EntityFields' takes '1' arguments Cannot apply indexing with [] to an expression of type 'CDMS.DAL.HelperClasses.EntityFields' Cannot apply indexing with [] to an expression of type 'CDMS.DAL.HelperClasses.EntityFields' Cannot apply indexing with [] to an expression of type 'CDMS.DAL.HelperClasses.EntityFields' The best overloaded method match for 'SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.GetScalar(SD.LLBLGen.Pro.ORMSupportClasses.IEntityFields, SD.LLBLGen.Pro.ORMSupportClasses.ITransaction, SD.LLBLGen.Pro.ORMSupportClasses.IPredicate, SD.LLBLGen.Pro.ORMSupportClasses.IRelationCollection, SD.LLBLGen.Pro.ORMSupportClasses.IGroupByCollection)' has some invalid arguments Argument '1': cannot convert from 'CDMS.DAL.HelperClasses.EntityFields' to 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityFields' 'EntityFields' is an ambiguous reference between 'CDMS.DAL.HelperClasses.EntityFields' and 'SD.LLBLGen.Pro.ORMSupportClasses.EntityFields' 'EntityFields' is an ambiguous reference between 'CDMS.DAL.HelperClasses.EntityFields' and 'SD.LLBLGen.Pro.ORMSupportClasses.EntityFields' No overload for method 'EntityFields' takes '1' arguments Cannot apply indexing with [] to an expression of type 'CDMS.DAL.HelperClasses.EntityFields' Cannot apply indexing with [] to an expression of type 'CDMS.DAL.HelperClasses.EntityFields' Cannot apply indexing with [] to an expression of type 'CDMS.DAL.HelperClasses.EntityFields'

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 03-Apr-2006 10:44:03   

All related to the same error:

'EntityFields' is an ambiguous reference between 'CDMS.DAL.HelperClasses.EntityFields' and 'SD.LLBLGen.Pro.ORMSupportClasses.EntityFields'

Try this: - rename Entity to something else - generate in a new empty folder - compile. You won't get this error.

Frans Bouma | Lead developer LLBLGen Pro
MRamesh
User
Posts: 8
Joined: 01-Apr-2006
# Posted on: 03-Apr-2006 11:52:26   

Thanks for your help. I changed Entity to other name and compiled. There is no issue now.