在尝试打开.xsd文件时,防止Visual Studio 2008创建.xsc和.xss文件

时间:2021-12-10 15:10:13

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?

我使用了xsd。为某些XML生成模式文件的exe。我想在Visual Studio的c#项目中包含这个模式文件,但是每次我将.xsd文件添加到我的项目中,然后双击它来打开它,Visual Studio就会为我的.xsd文件创建这些.xss和.xsc文件,并修改我的.xsd文件。我怎样才能让它停止自动地这样做并改变我的模式?

2 个解决方案

#1


5  

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

生成XSD文件后,在记事本中打开它并更新以下内容:

msdata:IsDataSet="false" (was true)

msdata:IsDataSet = " false "(是真的)

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

当您现在将文件导入Visual Studio时,它不应该创建额外的文件。

More info here.

更多的信息在这里。

#2


2  

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

如果处理原始XML没问题。

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

右键单击XSD,选择Open With。在对话框中,选择XML编辑器并单击“设置为默认”。

#1


5  

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

生成XSD文件后,在记事本中打开它并更新以下内容:

msdata:IsDataSet="false" (was true)

msdata:IsDataSet = " false "(是真的)

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

当您现在将文件导入Visual Studio时,它不应该创建额外的文件。

More info here.

更多的信息在这里。

#2


2  

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

如果处理原始XML没问题。

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

右键单击XSD,选择Open With。在对话框中,选择XML编辑器并单击“设置为默认”。