Неподдерживаемое исключение LoadObjectV2

Я создал пользовательский элемент управления со свойством типа SetOfImageFilenames:

[Serializable]
public class SetOfImageFilenames
{

    private string name;
    public string Name
    {
        get { return name; }
        set { name = value; }
    }

    private string image_filename;
    public string ImageFilename
    {
        get { return image_filename; }
        set { image_filename = value; }
    }

    private string image_disabled_filename;
    public string ImgageDisabledFilename
    {
        get { return image_disabled_filename; }
        set { image_disabled_filename = value; }
    }

    private string image_pressed_filename;
    public string ImagePressedFilename
    {
        get { return image_pressed_filename; }
        set { image_pressed_filename = value; }
    }

    public SetOfImageFilenames()
    {
        this.name = "";
        this.image_filename = "";
        this.image_disabled_filename = "";
        this.image_pressed_filename = "";
    }

    public SetOfImageFilenames(string image_filename, string 
    image_disabled_filename, string image_pressed_filename)
        : this()
    {
        this.image_filename = image_filename;
        this.image_disabled_filename = image_disabled_filename;
        this.image_pressed_filename = image_pressed_filename;
    }

    public SetOfImageFilenames(string image_filename, string 
    image_disabled_filename)
        : this(image_filename, image_disabled_filename, "")
    {
    }

    public SetOfImageFilenames(string image_filename)
        : this(image_filename, "", "")
    {
    }


}

Когда я добавляю элемент управления в панель инструментов и помещаю в форму в автономном режиме, все в порядке, но у меня есть ошибка времени выполнения:

NotSupportedException для метода ResourceReader.LoadObjectV2

Подробности:

FinalTestPrj.exe

NotSupportedException

System.Collections.Generic.List`1[[CwLib.Controls.SetOfImageFilenames, CwControlsLib, версия=1.0.6327.29280, культура=нейтральная, PublicKeyToken=null]]

в System.Resources.ResourceReader.LoadObjectV2 (Int32 pos, ResourceTypeCode и typeCode)\par

в System.Resources.ResourceReader.LoadObject(Int32 pos, ResourceTypeCode& typeCode)\par

в System.Resources.RuntimeResourceSet.GetObject (строковый ключ, логический ignoreCase)\par

в System.Resources.ResourceManager.GetObject (имя строки, культура CultureInfo)\par

в System.Resources.ResourceManager.GetObject(имя строки)\par

в FinalTestPrj.Form1.InitializeComponent()\par

в FinalTestPrj.Form1..ctor()\par

в FinalTestPrj.Program.Main()\par


person Sere    schedule 02.05.2017    source источник


Ответы (1)


похоже, вы развернули на своем устройстве System.dll для версии 1 компактной платформы, которая не содержит определения для LoadObjectV2.
Проверьте версию System.dll, которую вы используете в ссылках на ваш проект: в случае необходимости измените ее на 3.5

person salvolds    schedule 04.05.2017
comment
версия system.dll в порядке, 3.5. Проблема возникает, когда при запуске приложения возникают проблемы с общими коллекциями (List‹T›), когда свойства пользовательского элемента управления - person Sere; 16.05.2017