CF 3.5 projects - reference problems.

Posts   
 
    
Robert.W
User
Posts: 79
Joined: 19-Jun-2007
# Posted on: 04-Dec-2008 10:35:12   

Hi,

I have created a simple datbase in SQL Server and used LLBLGen to generate CF.NET 3.5 adapter projects for it (for use with SQL Server CE in a desktop application). They compile fine. When I reference those in my application the following line produces a compile error:

DataAccessAdapter adapter = new DataAccessAdapter();

Error 1 The type 'SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase' is defined in an assembly that is not referenced. You must add a reference to assembly 'SD.LLBLGen.Pro.ORMSupportClasses.NET20, Version=2.6.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27'.

I have those referenced which I thought would be enough: SD.LLBLGen.Pro.ORMSupportClasses.CF35 SD.LLBLGen.Pro.DQE.SqlServerCE.CF35

when I reference the mentioned SD.LLBLGen.Pro.ORMSupportClasses.NET20 I get the following compile time error:

The type 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection2' exists in both 'SD.LLBLGen.Pro.ORMSupportClasses.CF35.dll' and 'SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll'

I'm a bit lost now - which assemblies should I be referenciong in my application to make it work?

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 04-Dec-2008 11:18:25   

Are you sure you did generate the cide for CF.NET 3.5?

Please re-generate the code and make sure you have selected CF.NET 3.5 in the platform combo box.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 04-Dec-2008 11:34:03   

The namespace is the same, so the compile error is misleading. You should reference the CF35 build of the ORMSupportclasses dll.

Frans Bouma | Lead developer LLBLGen Pro
Robert.W
User
Posts: 79
Joined: 19-Jun-2007
# Posted on: 04-Dec-2008 12:43:55   

Walaa wrote:

Are you sure you did generate the cide for CF.NET 3.5?

Generated projects only reference:

SD.LLBLGen.Pro.ORMSupportClasses.CF35 SD.LLBLGen.Pro.DQE.SqlServerCE.CF35

I didn't touch any references there and CF.NET 3.5 was what I selected when generating code so I'm pretty much sure it is CF.NET 3.5.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 04-Dec-2008 12:53:34   

Aside from the generated code, your application should also reference the SD.LLBLGen.Pro.ORMSupportClasses.CF35 dll.

Robert.W
User
Posts: 79
Joined: 19-Jun-2007
# Posted on: 04-Dec-2008 13:06:05   

Walaa wrote:

Aside from the generated code, your application should also reference the SD.LLBLGen.Pro.ORMSupportClasses.CF35 dll.

I'm well aware of that - I'm referencing those CF35 assemblies in my app too. I have:

using SD.LLBLGen.Pro.ORMSupportClasses;

int the file I'm trying to use the adapter in and VS doesn't complain, I see those assemblies referenced in the References node in Solution Explorer.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 04-Dec-2008 14:14:47   

Would you please attach a repro solution?

Robert.W
User
Posts: 79
Joined: 19-Jun-2007
# Posted on: 04-Dec-2008 14:47:02   

While preparing a solution for you I was able to diagnose the problem I had. Seems I had an LLBLGen generated project (regular .net not CF) referenced in addition to CF LLBLGen projects. Removing that reference seems to have fixed things. Thanks for your help guys, and sorry for the trouble.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 04-Dec-2008 14:49:11   

Glad you have found it.

Good Luck.