views:

54

answers:

2

I used xsd.exe to generate a schema file for some XML. I want to include that schema file in my C# project in Visual Studio, but every time I add the .xsd file to my project and then double-click it to open it, Visual Studio creates these .xss and .xsc files for my .xsd file and it alters my .xsd file. How can I get it to stop automagically doing this and altering my schema?

A: 

If you're okay with just dealing with the raw XML

Right-Click the XSD, choose Open With.
In the dialog, choose XML editor and Click 'Set as Default.'

Jacob G
A: 

After generating the XSD file, open it in Notepad and update the following:

msdata:IsDataSet="false" (was true)

When you now import the file into Visual Studio, it shouldn't create the extra files.

More info here.

RaceFace