Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6917653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:45:27+00:00 2026-05-27T09:45:27+00:00

I recently migrated to new version of protobuf-net, and i started getting this error

  • 0

I recently migrated to new version of protobuf-net, and i started getting this error message after

Repeated data (a list, collection, etc) has inbuilt behaviour and cannot be used as a subclass

Call Stack Trace

protobuf-net.dll!ProtoBuf.Meta.MetaType.AddSubType(int fieldNumber = 1, System.Type derivedType = {Name = "InfoColumn`1" FullName = "Om.Common.InfoSet.InfoColumn`1[[System.Double, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}) Line 83    C#
protobuf-net.dll!ProtoBuf.Meta.MetaType.ApplyDefaultBehaviour() Line 431 + 0x32 bytes   C#

Any help in this regard is appreciated. I am planning to rollback my code to previous version of protobuf-net

Below is the class info.

[DataContract]
[ProtoInclude(1, typeof(InfoColumn<Double>))]
[ProtoInclude(2, typeof(InfoColumn<String>))]
[ProtoInclude(3, typeof(InfoColumn<DateTime>))]
[ProtoInclude(4, typeof(InfoColumn<Boolean>))]
public abstract class IInfoColumnBase 
{
    [DataMember(Order = 101)]
    public abstract bool IsSingleValue { get; set; }

    [DataMember(Order = 102)]
    public abstract string Name { get; set; }

    [DataMember(Order = 103)]
    public abstract InfoColumnDataType DataType { get; set; }
    public abstract long Insert();
    public abstract void Insert(long index);
    public abstract void SetValue(long index, object val);
    public abstract void CopyValues(long start, long end, IInfoColumnBase destCol, long index);
    public abstract long GetIndex(object val);
    public abstract void Remove(long index);
    public abstract object GetValue(long index);
    public abstract object GetInternalArrayValue(long index);
    public abstract void Clear();
    public abstract long Count { get; }
    public abstract long ArrayCount { get; }
}

public interface IInfoColumn<T>  : IEnumerable<T>
{
    T this[double index] { get; set; }
    InfoTable Table { get; set; }
    double Add(T item);
}


[DataContract(Name = "InfoColumn{0}")]
[KnownType(typeof(InfoColumn<double>))]
[KnownType(typeof(InfoColumn<String>))]
[KnownType(typeof(InfoColumn<bool>))]
[KnownType(typeof(InfoColumn<DateTime>))]
public class InfoColumn<T> : IInfoColumnBase, IInfoColumn<T> 
{
    long counter = 0;
    [DataMember(Order = 1)]
    public IList<T> Values { get; set; }

    //[DataMember(Order = 2)]
    bool isSingleVal = false;

    //[DataMember(Order=3)]
    public override string Name { get; set; }

    //[DataMember(Order=4)]
    public override InfoColumnDataType DataType { get; set; }

    public InfoTable Table { get; set; }


    public override long Count
    {
        get
        {
            return this.Table.Count;
        }
    }

    public override long ArrayCount
    {
        get { return this.Values.Count; } 
    }

    public InfoColumn()
    {
    }

    public InfoColumn(string name,InfoTable table)
    {
        this.Values = new List<T>();
        this.Name = name;
        this.Table = table;
    }

    public override void Clear()
    {
        this.Values = new List<T>();
    }

    public override void Remove(long index)
    {
        int newindex = (int)index;
        this.Values.RemoveAt(newindex);

    }



    public override void CopyValues(long start, long end, IInfoColumnBase destCol, long startIndex)
    {
        InfoColumn<T> typeCol = destCol as InfoColumn<T>;
        for (long ctr = start; ctr <= end; ctr++)
        {
            typeCol.SetValue(startIndex, this.Values[(int)ctr]);
            startIndex++;
        }
    }

    public override void Insert(long rows)
    {

        if (this.IsSingleValue == true) return;

        for (int ctr = 0; ctr < rows; ctr++)
        {
            this.Values.Add(default(T));
        }
    }

    public  T this[double a]
    {
        get
        {
            if (a >= this.Count) throw new IndexOutOfRangeException();
            long index = (long)a;
            if (this.Table.IsFreezed == false)
                index = this.Table.CheckData(a);


            if (this.isSingleVal == true)
                return this.Values[0];
            else 
                return this.Values[(int)index];
        }
        set
        {
            if (a >= this.Count) throw new IndexOutOfRangeException();

            long index = (long)a; 

            if (this.Table.IsFreezed == false)
                index = this.Table.CheckData(a);

            if (this.isSingleVal == true)
                this.Values[0] = value;
            else
                this.Values[(int)index] = value;

        }
    }

    public override long GetIndex(object val)
    {
        T item = (T)val;
        return this.Values.IndexOf(item);
    }

    public override void SetValue(long index, object val)
    {
        if (val is InfoSetLink)
            this.Values[(int)index] = (T)val;
        else
            this.Values[(int)index] = (T)Convert.ChangeType(val, typeof(T));
    }

    public override object GetValue(long index)
    {
        return this[index];
    }

    public override object GetInternalArrayValue(long index)
    {
        return this.Values[(int)index];
    }


    //[DataMember(Order=5)]
    public override bool IsSingleValue 
    {
        get { return isSingleVal; }
        set
        {
            if (isSingleVal == true)
            {
                this.Values = new List<T>(1);
            }
        }
    }

    public override long Insert()
    {
        if (this.IsSingleValue == true) return -1;
        this.Values.Add(default(T));
        return this.Values.Count - 1;
    }

    public double Add(T item)
    {
        this.Values.Add(item);
        return this.Values.Count - 1;
    }

    #region IEnumerable<T> Members

    public IEnumerator<T> GetEnumerator()
    {
        return new InfoColumnEnumerator<T>(this);
    }

    #endregion

    #region IEnumerable Members

    System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
    {
        return new InfoColumnEnumerator<T>(this);
    }

    #endregion


}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:45:27+00:00Added an answer on May 27, 2026 at 9:45 am

    InfoColumn<T> has a public Add(T) and implements IEnumerable<T> (via IInfoColumn<T>).

    There is wider support for list-like types in v2, and it may be that it is trying to interpret the above as a list. Which indeed, it does look a lot like! I will try to take a look to see if this general scenario can be detected and avoided, but it is an edge case (since it is indeed very list-esque).

    There is an existing IgnoreListBehaviour switch, however when validating this for the model shown above, it seems that for this specific scenario the “you can’t do that” fires before the code that disables list handling; I have changed this in the source, and this will be included in the next release. Basically, you can address this by adding:

    [ProtoContract(IgnoreListHandling = true)]
    

    to the impacted type (InfoColumn<T>), with the next build. Which will be shortly, as soon as I’ve completed validation etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this error recently, after I migrated my site to a new server
I receive this error when trying to run a node.js server. I recently migrated
I recently migrated a website to a new CMS (Umbraco). A lot of the
We just recently migrated our web application from .NET 1.1 to .NET 2.0. The
We had an application using axis2 1.0. We recently migrated to axis2 1.4. After
I recently migrated one of my domains to a new hosting service, so I
I recently migrated a WordPress site to a new server and new domain name.
i recently migrated my whole DB from myisam to innodb. I am fairly new
I recently migrated from rails 2 to Rails 3 and thus got the new
We are having a serious problem on the new CRM 2011-server. We recently migrated

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.