Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Visual Studio 2008 from creating .xsc and .xss files when I try to open an .xsd file

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?

like image 530
Sarah Vessels Avatar asked Jul 20 '10 15:07

Sarah Vessels


2 Answers

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.

like image 192
Dunc Avatar answered Oct 19 '22 22:10

Dunc


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.'

like image 33
Jacob G Avatar answered Oct 20 '22 00:10

Jacob G