6

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; }
   }
}
1
  • Does the form have an ImageList, and is the project targeting .NET 3.5?
    – Jeff Ogata
    May 11, 2011 at 22:42

2 Answers 2

8

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>
1
  • 2
    This doesn't work; It's a temporary fix. next re-build, it's back!
    – n00dles
    Jul 25, 2017 at 23:04
0

Have you tried to create new UserControl and copy your code into its *.cs file? Maybe your resx file is damaged..
Update:
your question seems similar to this one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.