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.
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:
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.OutOfMemoryExceptionand build failures I was seeing. Once I removed the file from the resources, the solution could be built as expected.