'ISerializable' is an ambiguous reference

Posts   
 
    
Waveslam
User
Posts: 18
Joined: 20-Nov-2006
# Posted on: 31-Jan-2008 05:31:38   

Hi, I have recently loaded up a LLBLBenPro-based solution that I haven't looked at since we upgraded to LLBLGen Pro v2.5 (from v2.0), but it will now not compile.

For every single Entity class in the project, I get these compile errors: "'ISerializable' is an ambiguous reference between 'System.Runtime.Serialization.ISerializable' and 'SD.LLBLGen.Pro.ORMSupportClasses.ISerializable'"

and

'SerializationInfo' is an ambiguous reference between 'System.Runtime.Serialization.SerializationInfo' and 'SD.LLBLGen.Pro.ORMSupportClasses.SerializationInfo'

As an example, here the first part of the code that is generated for each of our entities:

///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 2.5
// Code is generated on: Thursday, 31 January 2008 4:46:44 p.m.
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using CBSCanterbury.DAL.BossProd.Adapter;
using CBSCanterbury.DAL.BossProd.Adapter.HelperClasses;
using CBSCanterbury.DAL.BossProd.Adapter.FactoryClasses;
using CBSCanterbury.DAL.BossProd.Adapter.RelationClasses;

using SD.LLBLGen.Pro.ORMSupportClasses;

namespace CBSCanterbury.DAL.BossProd.Adapter.EntityClasses
{
    
    // __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
    // __LLBLGENPRO_USER_CODE_REGION_END

    /// <summary>
    /// Entity class which represents the entity 'IbCard'.<br/><br/>
    /// 
    /// </summary>
    [Serializable]
    public partial class IbCardEntity : CommonEntityBase, ISerializable
        // __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
        // __LLBLGENPRO_USER_CODE_REGION_END    
    {

It is the ISerializable that appears in the line:

    public partial class IbCardEntity : CommonEntityBase, ISerializable

that is causing the compile errors.

We are using LLBLGenPro 2.5, generating C# 2.0 using the standard adapter templates. Note that the solution was originally created using code generated using LLBLGenPro v2.0, but we subsequently upgraded to v2.5. I have regenerated the code using v2.5 but that didn't help. I have also uninstalled v2.0 using Control Panel but no luck.

I have checked the References for each project in the solution and as far as I can see they are referencing v2.5 of the SD.LLBLGen.Pro.ORMSupportClasses.NET20 assembly.

I am assuming its some simple reference problem but I just cant work it out.

Thanks in advance

Regards Brett

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 31-Jan-2008 10:09:43   

Would you please make sure the generated code references the correct v.2.5 of the .NET2.0 dlls of the ORMSupportClasses? Not the CF ones, not anything else.

If you still can't figure it out, would you please attach a repro project? (Not the real one, make it a repro one... as you might solve it when you try to repro it).

Waveslam
User
Posts: 18
Joined: 20-Nov-2006
# Posted on: 31-Jan-2008 20:52:43   

Man, you are GOOD...! ;-)

Turns out that just as you suspected, I had inadvertently referenced the CF version of the ORMSupportClasses DLL in one of my projects.

Thanks heaps for your help and sorry to waste your time!

Cheers Brett