T
Trey Balut
How do I fix the following error ?
"The type or namespace name 'Soap' does not exist in the namespace
'System.Runtime.Serialization.Formatters' (are you missing an assembly
reference?)"
Here is my source code:
public static bool Serialize(System.Object myObject, string
writeToXmlPath)
{
bool state = true;
System.Runtime.Serialization.IFormatter formatter = null;
System.IO.Stream stream = null;
try
{
/*********************************The next line is the
error*******************/
formatter = new
System.Runtime.Serialization.Formatters.Soap.SoapFormatter();
stream = new System.IO.FileStream(writeToXmlPath,
FileMode.Create, FileAccess.Write, FileShare.None);
formatter.Serialize(stream, myObject);
}
catch (System.Exception ex)
{
state = false;
System.Diagnostics.Debug.WriteLine(ex.ToString());
}
finally
{
stream.Close();
formatter = null;
stream = null;
}
return state;
}
Thanks,
Trey
"The type or namespace name 'Soap' does not exist in the namespace
'System.Runtime.Serialization.Formatters' (are you missing an assembly
reference?)"
Here is my source code:
public static bool Serialize(System.Object myObject, string
writeToXmlPath)
{
bool state = true;
System.Runtime.Serialization.IFormatter formatter = null;
System.IO.Stream stream = null;
try
{
/*********************************The next line is the
error*******************/
formatter = new
System.Runtime.Serialization.Formatters.Soap.SoapFormatter();
stream = new System.IO.FileStream(writeToXmlPath,
FileMode.Create, FileAccess.Write, FileShare.None);
formatter.Serialize(stream, myObject);
}
catch (System.Exception ex)
{
state = false;
System.Diagnostics.Debug.WriteLine(ex.ToString());
}
finally
{
stream.Close();
formatter = null;
stream = null;
}
return state;
}
Thanks,
Trey