The problem is I have a test class and a TestVariable and I would like to Serialize the Test Class without Serializing the TestVariable.:
public class TestClass
{
public int TestVariable
{
get;
set;
}
public int ControlVariable
{
get;
set;
}
public TestClass()
{
TestVariable = 1000;
ControlVariable = 9999;
}
}
The Code that does the serialization:
public static void PrintClass()
{
new XmlSerializer(typeof(TestClass)).Serialize(Console.Out, new TestClass());
}