Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid Resx file. Could not load type System.Collections.Generic.List

Tags:

c#

properties

I have property on my usercontrol but when i add usercontrol to my foem and want to run, i got this error on visual studio 2010 but this error dosn't appear on VS 2008: "Invalid Resx file. Could not load type System.Collections.Generic.List...."

[Serializable]
public class ActionPoint
{
public string CarInfo;
public string RightStationName;
public string RightStationInfo;
public string LeftStationName;
public string LeftStationInfo;

public ActionPoint()
{
}
}
public class Line : UserControl
{ 
   public List<ActionPoint> Stations
   {
   get { return Stations; }
   set { Stations = value; }
   }
}
like image 351
MH2538 Avatar asked Mar 02 '11 07:03

MH2538


1 Answers

If you check in your resx-file, do you have a data section?

I have no idea what exactly happened but what worked for me was to remove the two data sections where the binary (serialized) data was stored:

  <data name="myListView1.DataSource" mimetype="application/x-microsoft.net.object.binary.base64">
    <value>
        AAEAAAD/////AQAAAAAAAAAMAgAAAJYBU2tvbGVwb3J0ZW5BZGRpbiwgVmVyc2lvbj0xLjAuMC4wLCBD
        dWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXSwgbXNjb3JsaWIsIFZlcnNpb249NC4w
        LjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5DAMAAABH
        U2tvbGVwb3J0ZW5BZGRpbiwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tl
        eVRva2VuPW51bGwFAQAAAENTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW1Nrb2xlcG9y
        dGVuQWRkaW4uTW9kZWxzLkppcmFJdGVtAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAiU2tvbGVw
        b3J0ZW5BZGRpbi5Nb2RlbHMuSmlyYUl0ZW1bXQMAAAAICAIAAAAJBAAAAAAAAAABAAAABwQAAAAAAQAA
        AAAAAAAEIFNrb2xlcG9ydGVuQWRkaW4uTW9kZWxzLkppcmFJdGVtAwAAAAs=
</value>
  </data>
  <data name="myListView2.DataSource" mimetype="application/x-microsoft.net.object.binary.base64">
    <value>
        AAEAAAD/////AQAAAAAAAAAMAgAAAJYBU2tvbGVwb3J0ZW5BZGRpbiwgVmVyc2lvbj0xLjAuMC4wLCBD
        dWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXSwgbXNjb3JsaWIsIFZlcnNpb249NC4w
        LjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5DAMAAABH
        U2tvbGVwb3J0ZW5BZGRpbiwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tl
        eVRva2VuPW51bGwFAQAAAENTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW1Nrb2xlcG9y
        dGVuQWRkaW4uTW9kZWxzLkppcmFJdGVtAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAiU2tvbGVw
        b3J0ZW5BZGRpbi5Nb2RlbHMuSmlyYUl0ZW1bXQMAAAAICAIAAAAJBAAAAAAAAAABAAAABwQAAAAAAQAA
        AAAAAAAEIFNrb2xlcG9ydGVuQWRkaW4uTW9kZWxzLkppcmFJdGVtAwAAAAs=
</value>
  </data>
like image 150
Marcus Avatar answered Oct 06 '22 00:10

Marcus