【问题标题】:Custom tool error Failed to generate code自定义工具报错无法生成代码
【发布时间】:2011-05-02 18:54:42
【问题描述】:

为什么会出现这个错误?我只是在数据集设计器中设置了一些默认值...这是第二次出现...
“自定义工具错误无法生成代码。抛出了'System.OutOfMemoryException'类型的异常”

【问题讨论】:

  • 你的系统有多少内存?
  • @Lasse:Windows 7 x86 上 1 GB

标签: visual-studio-2010 dataset-designer customtool custom-tools


【解决方案1】:

当我在 Visual Studio 2019 上将目标框架从 .net 4.5 更改为 .net 4.8 时,发生了这种情况。

对我来说,Connections 标记正在寻找不再存在的全局连接字符串或 DatabaseProvinder。

如果你不再需要连接,你可以摆脱它。

这样做:

1- Right-click on the .xsd file chose open with and chose 'XML (Text) Editor', or another text editor that you prefer. 

2- Delete de content of the Connections tag and closes it.

之后,你会有这样的东西:

...
<DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
    <Connections />
    <Tables />
    <Sources />
  </DataSource>
...

Reference / Similar question

【讨论】:

    【解决方案2】:

    我刚刚找到了一种重新生成代码的方法。
    Solution Explorer 中右键单击您的数据集,然后单击Run Custom Tool
    我在关闭并重新打开 VS2010 后执行此操作...
    希望这对您有所帮助,如果您遇到问题...
    祝你好运

    【讨论】:

      猜你喜欢
      • 2013-12-26
      • 1970-01-01
      • 2012-02-12
      • 2016-10-03
      • 2015-11-24
      • 1970-01-01
      • 1970-01-01
      • 2021-01-21
      • 1970-01-01
      相关资源
      最近更新 更多