I have tried (and failed) do do the following.
-
Create a sample XML file.
<?xml version="1.0" encoding="utf-8"?>
<test1>
<test2>Test3</test2>
</test1> -
Run it through Visual Studio 2010’s
xsdto generate an XSD file.xsd test.xml -
Add the XSD file to a C# project in Visual Studio 2010. This adds the files:
test.Designer.cstest.xsctest.xss
and shows up in the designer view as indicated below.

-
Then I try to deserialize the file that started the whole thing:
var reader = new FileStream("xml/test.xml", FileMode.Open);
var serializer = new System.Xml.Serialization.XmlSerializer(typeof(NewDataSet));
var test = serializer.Deserialize(reader);
and I get the error

The inner exception says {"<test1 xmlns=''> was not expected."}
What am I doing wrong? Or should I use xsd to generate the class also?
OK, that seems to be it:
xsd test.xsd /cgenerates
test.csan using this as the type, rather thanNewDatadeserializes correctly.