VbMyResourcesResXFileCodeGenerator生成System.OutOfMemoryException(VbMyResourcesResXFileCodeGenerator g

系统教程 行业动态 更新时间:2024-06-14 17:03:52
VbMyResourcesResXFileCodeGenerator生成System.OutOfMemoryException(VbMyResourcesResXFileCodeGenerator generates System.OutOfMemoryException)

最近我的VB.Net项目在构建时失败,提出了一个对话框(大约):

External Tool: VbMyResourcesResXFileCodeGenerator failed due to a System.OutOfMemoryException

我将此问题和答案作为公共服务发布给未来的搜索者并遇到同样的问题 - 特别是因为要弄清楚并不容易。

Recently my VB.Net project failed while building, raising a dialog that said (approximately):

External Tool: VbMyResourcesResXFileCodeGenerator failed due to a System.OutOfMemoryException

I'm posting this question and answer as a public service for future searchers with the same problem - in particular because it wasn't easy to figure out.

最满意答案

寻找解决问题的线索引出了我的问题: Visual Studio 2010 - (OutOfMemoryException)&(理想状态下的内存增加) - 以及尝试使用Solution Load Manager减少内存使用的建议。 只有加载失败的项目,在启动VS2010后,我可以从解决方案资源管理器上下文菜单中成功执行resx文件上的“运行自定义工具”,然后构建应用程序。

然而,不久之后,构建开始无声地失败,就像这张海报的情况一样: Visual Studio 2010 IDE构建失败,没有任何错误或警告在他的问题的评论中我发现了我的救赎:

您必须转到Visual Studio选项对话框并导航到项目和解决方案| 构建并运行。 将MSBuild项目构建输出详细程度更改为Detailed或Diagnostic,然后分析输出。 这应该给你提示根本原因是什么。

一旦我这样做,我就能再次看到无法构建resource.resx文件。

最终的问题被证明是一个被遗忘的文件资源。 我以前嵌入了一个文件作为资源,随后通过添加几个屏幕截图显着增加了该文件的大小。 虽然我不再在我的代码中使用该文件,但我没有将其作为项目资源删除。 这个文件的大小最终导致System.OutOfMemoryException和我看到的构建失败。 从资源中删除文件后,可以按预期构建解决方案。

Searching for a clue to resolve the issue lead me to this question: Visual Studio 2010 - (OutOfMemoryException) & (Memory increase in Ideal State) - and a suggestion to try the Solution Load Manager to reduce memory use. With only the failing project loaded, immediately after starting VS2010, I could successfully execute 'run custom tool' on the resx file from the solution explorer context menu and then build the application.

However, shortly afterwards the build began to silently fail, much like this poster's situation: Visual studio 2010 IDE build fails mysteriously with no errors or warnings In the comments to his question I found my salvation:

You will have to go to Visual Studio Options dialog and navigate to Projects and Solutions | Build and Run. Change MSBuild project build output verbosity to Detailed or Diagnostic and then analyze the output. That should give you hint on what is the root cause.

Once I did so, I was able to see that, again, the resource.resx file couldn't be built.

The ultimate issue turned out to be a forgotten file resource. I had previously embedded a file as a resource, and subsequently increased that file's size significantly by adding several screenshots. Although I was no longer using the file in my code, I hadn't deleted it as a project resource. It was the size of this file that eventually caused the System.OutOfMemoryException and build failures I was seeing. Once I removed the file from the resources, the solution could be built as expected.

更多推荐

本文发布于:2023-04-24 12:24:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/26fb9ecd92ea3d047222938b7ac731f3.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:System   VbMyResourcesResXFileCodeGenerator   generates   OutOfMemoryException

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!