为什么我会收到错误的“DataSet11.Designer.cs”。在我的Dataset1.cs下? [英] Why do I get an erroneous "DataSet11.Designer.cs" under my Dataset1.cs?

查看:152
本文介绍了为什么我会收到错误的“DataSet11.Designer.cs”。在我的Dataset1.cs下?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


使用多个表摆弄DataSet Designer之后(如果重要的话,它们涉及来自SQLite的外键),我偶尔会得到一个"DataSet11.Designer.cs"。在重建之后或在"运行自定义
工具"之后的DataSet1.cs下(如上图所示)命令。使用该文件进行调试/扩展会产生多个重复错误,删除它会让应用程序编译,但现在似乎缺少用于DataSet1.Designer.cs的代码。



有谁知道可能导致DataSet Designer出现这种情况的原因?


PS。最初发布在  https://social.msdn.microsoft.com/Forums/vstudio/en-US/0ff24b1b-7b63-442e-94a8-c61741b9e687/why-do-i- get-an-misroneous-dataset11designercs-under-my-dataset1cs?forum = wpf
其中找到初步解决方案


解决方案

不知道你究竟是什么"摆弄"了我或你如何摆弄它,我只能提出一个全面的建议。我*永远不会在Designer UI中弄乱DataSet。它通常最终会生成不需要的代码。相反,我将.xsd打开为XML
并改为使用它。


在解决方案资源管理器中,右键单击.xsd并选择"打开方式"。然后更改它,以便使用"XML(文本)编辑器"打开它。如果您愿意,可以设置为默认值。


如果您有兴趣,我写了一些关于MSDataSetGenerator和.xsd的博客文章。此搜索查询列出了一些:


http ://geek-goddess-bonnie.blogspot.com/search q = MSDataSetGenerator


After fiddling with the DataSet Designer with multiple Tables (they involve Foreign Keys from SQLite if it matters), I occasionally get a "DataSet11.Designer.cs" under DataSet1.cs (as in image above) after a rebuild or after a "Run Custom Tool" command. Debugging/bulding with that file gives multiple errors of duplication, deleting it lets the application compile, but it appears to be missing code now that was intended for DataSet1.Designer.cs.

Does anyone know what might be causing this behavior of DataSet Designer?

PS. Originally posted in https://social.msdn.microsoft.com/Forums/vstudio/en-US/0ff24b1b-7b63-442e-94a8-c61741b9e687/why-do-i-get-an-erroneous-dataset11designercs-under-my-dataset1cs?forum=wpf where a preliminary solution is found

解决方案

Not knowing exactly what you "fiddled" with, or how you fiddled with it, I can only make a blanket suggestion. I *never* mess with a DataSet in the Designer UI. It typically will end up generating unwanted code. Instead, I open the .xsd as XML and fiddle with that instead.

In your Solution Explorer, right-click your .xsd and choose "Open With". Then change it so that you open it with the "XML (Text) Editor". You can Set as Default if you'd like to.

I wrote a few blog posts about MSDataSetGenerator and about .xsd's, if you're interested. This search query lists a few:

http://geek-goddess-bonnie.blogspot.com/search?q=MSDataSetGenerator


这篇关于为什么我会收到错误的“DataSet11.Designer.cs”。在我的Dataset1.cs下?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆