I am trying to create an XML schema to be serialized/deserilized using visual studio 2010, but it looks really complicated having an xml file and another xml schema file, I didn't get how it should be done. I rememeber in visual studio 2005 it was much simpler by just creating xml file and open it with the xml designer then draw the schema, then generate the serializable code out of the schema. Any hint/ link that would help in doing the same using Visual Studio 2010 professional.
Let me try to answer this:
Then you can create your own class for the serialize/deserialize process or use xsd.exe
I used the last one. In my case I can found the tool in the \Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\xsd.exe.
Then you can open CMD or the Visual Studio command window and write something like: xsd.exe [THE XSD FILE] /c /l:c# /o:[DIRECTORY WHERE YOU WANT TO SAVE THE .CS]
I hope this works for you or answer your question. Pretty much I used the same approach with VS 2008 and 2010.
Here are related topics just in case:
XSD tool: https://docs.microsoft.com/en-us/dotnet/standard/serialization/xml-schema-definition-tool-xsd-exe
XML Serialization and Schema without xsd.exe
Generate classes from XSD
if you don't have the Microsoft SDK you can get it from: https://docs.microsoft.com/en-us/dotnet/core/sdk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With