问题描述
我使用VS2010(C#)的WinForm的数据库程序。我创建了一个数据集,myds,产生了几个相关文件:
I'm using VS2010 (C#) for a WinForm database program. I've created a dataset, myds, which generates a couple of related files:
- myds.xsd
- myds.Designer.cs
- myds.xsc
- myds.xss
- myds.xsd
- myds.Designer.cs
- myds.xsc
- myds.xss
当我编辑在设计模式XSD文件,也许只是围绕一个TableAdapter移动,myds.Designer.cs使得其自身的副本myds1.Designer.cs。从那以后,我不能编译程序,因为所有的类型和定义变得声明两次(他们媒体链接存在于原始myds.Designer.cs文件)。这是很烦人有每次我做了该文件的细微变化时间删除该副本。为什么这样做,我可以防止VS2010从做这个副本?
When I edit the xsd-file in design mode, perhaps just move around a TableAdapter, myds.Designer.cs makes a copy of itself to myds1.Designer.cs. After that I can't compile the program because the all the types and definitions becomes declared twice (they allready exists in the original myds.Designer.cs-file). It's quite annoying having to delete the copy every time I've made minor changes to that file. Why is it doing this, and can I prevent VS2010 from making this copy?
推荐答案
这是一个已知的bug。
It is a known bug.
解决方案
卸载包含您的数据集中的项目。
Unload the project containing your dataset.
编辑用文本编辑器项目文件(例如,datasetobjects.csproj')。
如果您有其他数据集,你可以找到行为:
Edit the project file (example 'datasetobjects.csproj') with text editor.If you have another datasets you can find rows as:
<None Include="My_DS.xsd">
<SubType>Designer</SubType>
<Generator>MSDataSetGenerator</Generator>
<LastGenOutput>My_DS.Designer.cs</LastGenOutput>
</None>
和问题是该行中< LastGenOutput> My_DS.Designer。 CS< / LastGenOutput>
。
这可能是misssing或不正确为您的数据集。
And the problem is in the row <LastGenOutput>My_DS.Designer.cs</LastGenOutput>
.It may be misssing or incorrect for your DataSet.
的。
这篇关于VS2010做了.Designer.cs文件的副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!