title: Serialization system.object
body: <p>I'm trying to create a webservice to return a generic. The return class looks like this:</p>
  
  <pre><code>[Serializable]
  public class RenderReturn
  {
      public RenderReturnStatus StatusReturn { get; set; }
      public string MessageReturn { get; set; }
      public string MessageTitle { get; set; }
      public object **ObjectReturn** { get; set; }
  }
  </code></pre>
  
  <p>Where <code>ObjectReturn</code> can be an object or a list of application objects, like cars, customers, etc..</p>
  
  <p>But the webservice returns the following error:</p>
  
  <pre>
  System.InvalidOperationException: There was an error generating the XML document. --->
  System.InvalidOperationException: The type Environment was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically.
     at System.Xml.Serialization.XmlSerializationWriter.WriteTypedPrimitive(String name, String ns, Object o, Boolean xsiType)
  </pre>
  
  <p>This is possible or method should always return specific types?</p>