STL\CLR serialization & containers

Will the containers within STL\CLR support the Serialization attribute

Im using the alpha verisons and when i try to serialize a vector i get the following error message:

Failed to serialize. Reason: Type 'cliext.vector<FunctionBase ^>' in
Assembly 'Runtime2, Version=1.0.2161.21524, Culture=neutral,
PublicKeyToken=null' is not marked as serializable

To continue must i now implement the ISerializable interface and serialize the items myself  





Answer this question

STL\CLR serialization & containers

  • Jaziel

    Suggestions could be made at http://lab.msdn.microsoft.com/productfeedback/default.aspx.

    Thanks,
      Ayman Shoukry
      VC++ Team

  • EamonnH

    I have to say that I am not even sure on what version of STL/CLR you are looking right now. :-) I assume you are talking about STL/CLR in Beta 2. You clearly do not have "alpha version" because it has not been released yet. Well if you do, I would love to take a look at it. :-) 

    To answer your question specifically. No, containers are not serializable. Of course, you should be able to sub-class and implement your own serialization. But I personally think it is a nice feature to add to STL/CLR. Why don't you open a suggestion bug for STL/CLR that you would like to see containers in STL/CLR be serializable. I would not expect this feature being implemented in time for web-release, but in the next release of VS if at all.





  • Dave Dunckley

    I have the version that is present with my beta version of 2005.

    Where exactly should i open this suggestion you recommend

    I was intending to implement ISerializable and do it myself, but it seems for each object contained i have to provide an identity for it.

       for( int c=0; c< mVector.Size(); c++ )
          info.AddValue( c, mVectorCoffee );

    How exactly would i implement serialization myself for a vector of objects




  • STL\CLR serialization & containers