Click here to Skip to main content
13,259,779 members (48,995 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


6 bookmarked
Posted 27 Aug 2012

Out of Memory in Visual Studio

, 27 Aug 2012
Rate this:
Please Sign up or sign in to vote.
The "ResolveManifestFiles" task failed unexpectedly. System.OutOfMemoryException: Insufficient memory to continue the execution of the program.


As part of assignment, I was working on a project, which is having 137 projects Windows Form in a solution. Whenever I was building my solution, I was getting Out-Of-Memory error and due to this my Visual Studio use to get crash. Then the only solution left with me was to restart my Visual Studio L. Earlier I as facing this issue once a while, but from last week, it is occurring frequently. Hope you can imagine, how painful it is restart the Visual Studio every now-and-then, especially when your solution contains such a huge number of projects. My error was something like this: “The "ResolveManifestFiles" task failed unexpectedly. System.OutOfMemoryException: Insufficient memory to continue the execution of the program.”

The only thing, which was coming into my mind, was that it is due to Visual Studio’s memory limits. I also tried to minimize Visual Studio, but no luckL.

After consulting with few people, I got an idea to breakup my solution into multiple solutions. But again, it was not the best solution for me because my project was already on the last stage (about to over) and it was not the correct time to take this much big risk. So, I dropped this suggestion also.

After hitting my head for 4-5 days, I reached to some conclusion. One of the reasons was Heap fragmentation, due to which, my Virtual Memory was keep raising and ultimately it was affecting my GC. But this reason was also not 100% correct. Because Virtual Memory will rise, only when I’ll run my application. But in my case, I was getting error during build itself. So, again no luck L

While doing analysis on the same, I thought, let’s open manifest file and check once. And luckily I got the clue. On opening manifest file, I found that there are lot of hash values which are nothing but my image files. In my project I was using approx 150 image files. According to my project requirement, we were not supposed to deploy those image files. Then what those files were doing there, why they are part of my manifest?  Now a very BIG question was, how those image files became part of my manifest?

This happened because Visual Studio, by default sets image’s ‘Build Action’ property to ‘Content’. As soon as I changed this property to ‘None’, my error goes off. This one small property worked like a charm for me J

By setting ‘Build Action’ property to ‘None’, I was able to reduce the size of manifest file to approx 0.9GB.

I shared this as a tip, so that you need not to spend 5-6 days, to analyze the issue J

Points of Interest

Whenever you get out of memory error in visual studio, one possible reason can be due to huge manifest file. So, just try to play around it and you will get some clue Smile | :)


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

You may also be interested in...


Comments and Discussions

QuestionHow to apply it in Visual Studio 2005? Pin
Budisanto Tanoto15-Jun-16 19:20
memberBudisanto Tanoto15-Jun-16 19:20 
QuestionProblem generating manifest. Insufficient memory to continue the execution of the program Pin
Rakesh Meel18-Jun-15 22:00
professionalRakesh Meel18-Jun-15 22:00 
QuestionOut of Memory in Visual Basic 6.0 Pin
Member 1130203810-Dec-14 15:41
memberMember 1130203810-Dec-14 15:41 
QuestionWhere is the Build Action Setting? Pin
Joe Sweeney24-Apr-13 10:50
memberJoe Sweeney24-Apr-13 10:50 
GeneralMy vote of 5 Pin
Christian Amado27-Aug-12 10:17
memberChristian Amado27-Aug-12 10:17 
Nice tip!

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171114.1 | Last Updated 27 Aug 2012
Article Copyright 2012 by Shweta Lodha
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid