Unanswered Serialization in SandBoxSolutions

  • Sunday, June 27, 2010 2:06 PM
     
     

    Hi,

    I am building a SnadBox solution webPart that will store some data in SPWeb properties using spweb.AddProperty method.

    I have build a custom configuration class and marked as serializable:

     

    [Serializable]

    public class MyConfig

    {

    public long size {get;set;}

    public string text {get;set;}

    }

     

    I get the SPWeb from the current context but when calling web.AddProperty("Key",new MyConfig()) I get the following error:

    System.Runtime.Serialization.SerializationException was unhandled  Message=Unable to find assembly ....

    The method works just fine if I add the primitives dirrectly as string and long but not when I am trying to serialize my class.

    It does seems like the serialization mechanism can't find the assembly so I wonder how the WF will find the assembly when is going to serialize/dehidrade.

    Please advise.

    My current solution would be to write methods that will manually serialize/deserialize the config class into a string but will require more code.

     

All Replies