2017-05-02 3 views
0

NotSupportedException이 나는 타입 SetOfImageFilenames의 속성을 가진 UserControl을 생성 :LoadObjectV2

[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, "", "") 
    { 
    } 


} 

내가 도구 상자에 컨트롤을 추가하고 오프라인 양식에 넣었을 때, 모든 권리,하지만 난 런타임 오류가 : 당신이 LoadObjectV2에 대한 정의를 포함하지 않는 컴팩트 프레임 워크 버전 1에 대한 장치 System.dll을에 배치 같은

NotSupportedException on method ResourceReader.LoadObjectV2

Details:

FinalTestPrj.exe

NotSupportedException

System.Collections.Generic.List`1[[CwLib.Controls.SetOfImageFilenames, CwControlsLib, Version=1.0.6327.29280, Culture=neutral, PublicKeyToken=null]]

at System.Resources.ResourceReader.LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode)\par

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

at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean ignoreCase)\par

at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture)\par

at System.Resources.ResourceManager.GetObject(String name)\par

at FinalTestPrj.Form1.InitializeComponent()\par

at FinalTestPrj.Form1..ctor()\par

at FinalTestPrj.Program.Main()\par

답변

0

것 같습니다.
당신이 당신의 프로젝트 참조에 사용하는 System.dll을의 버전을 확인합니다 경우 3.5

+0

로 변경 System.dll을 버전은 괜찮습니다, 3.5이다. 문제가 발생하면 응용 프로그램을 실행할 때 사용자 지정 컨트롤의 속성이있을 때 제네릭 컬렉션 (List )에 문제가 있습니다. – Sere