ProjectTraker throws error - missing definition for AddRange

ProjectTraker throws error - missing definition for AddRange

Old forum URL: forums.lhotka.net/forums/t/5476.aspx


hampole posted on Friday, September 26, 2008

I am trying to build ProjectTraker and getting the following errors.
'ProjectTracker.Library.ProjectList does not contain a definition for 'AddRange' and no extension method 'AddRange' accepting a first argument of type 'ProjectTracker.Library.ProjectList' could be found (are you missing a using directive or an assembly reference?)

Whereever there is ref. to AddRange, I am getting the error. Am I missing something? Please help.

Thanks,
Ravi

Here is code snippet:
    private void DataPortal_Fetch()
    {
      this.RaiseListChangedEvents = false;
      using (var ctx = ContextManager<ProjectTracker.DalLinq.PTrackerDataContext>.GetManager(ProjectTracker.DalLinq.Database.PTracker))
      {
        var data = from role in ctx.DataContext.Roles
                   select new NameValuePair(role.Id, role.Name);
        IsReadOnly = false;
        this.AddRange(data);
        IsReadOnly = true;
      }
      this.RaiseListChangedEvents = true;
    }

sergeyb replied on Friday, September 26, 2008

You probably have done this already, but did you make sure references to CSLA are valid In that project?  Also, what version of .NET framework are you using for compilation?

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: hampole [mailto:cslanet@lhotka.net]
Sent: Friday, September 26, 2008 4:41 PM
To: Sergey Barskiy
Subject: [CSLA .NET] ProjectTraker throws error - missing definition for AddRange

 

I am trying to build ProjectTraker and getting the following errors.
'ProjectTracker.Library.ProjectList does not contain a definition for 'AddRange' and no extension method 'AddRange' accepting a first argument of type 'ProjectTracker.Library.ProjectList' could be found (are you missing a using directive or an assembly reference?)

Whereever there is ref. to AddRange, I am getting the error. Am I missing something? Please help.

Thanks,
Ravi

Here is code snippet:
    private void DataPortal_Fetch()
    {
      this.RaiseListChangedEvents = false;
      using (var ctx = ContextManager<ProjectTracker.DalLinq.PTrackerDataContext>.GetManager(ProjectTracker.DalLinq.Database.PTracker))
      {
        var data = from role in ctx.DataContext.Roles
                   select new NameValuePair(role.Id, role.Name);
        IsReadOnly = false;
        this.AddRange(data);
        IsReadOnly = true;
      }
      this.RaiseListChangedEvents = true;
    }



hampole replied on Friday, September 26, 2008

I am using VS2008 with .Net3.5 and CSLA3.5(3.5.1). I have all the references to CSLA. I appreciate your help.

Ravi

sergeyb replied on Friday, September 26, 2008

This is strange.  AddRange is part of ExtendedBindingList that NameValueList inherits from.  Try to just follow “Go to Definition ” from NameValueListBase that this class inherits from to see if you can get to ExtendedBindingList and find AddRange method.  It is strange that it does not compile for you though…

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: hampole [mailto:cslanet@lhotka.net]
Sent: Friday, September 26, 2008 4:53 PM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: ProjectTraker throws error - missing definition for AddRange

 

I am using VS2008 with .Net3.5 and CSLA3.5(3.5.1). I have all the references to CSLA. I appreciate your help.

Ravi


hampole replied on Friday, September 26, 2008

I resolved the issue. I downloaded CSLA3.5.2 and I am able to build. Looks like the 3.5.1 does not have the AddRange definition.

Thanks,
Ravi

Copyright (c) Marimer LLC