Is it safe to delete the "ipch" folder - Precompiled headers?

Visual Studio-2010

Visual Studio-2010 Problem Overview


I was looking through the folder for an application I am working on and noticed the "ipch" folder, for my solution which has two small projects it weighs in at about 90mb+ in size.

I have found an article discussing the use for the files and was wondering if they were safe to delete? I would like to keep the applications footprint as small as possible. If I were to delete the folder will the application remain in a safe and stable state?

Pre-Compiled Headers

Visual Studio-2010 Solutions


Solution 1 - Visual Studio-2010

Managed to find a pretty informative answer from the MSDN support forums:

> I'm not only a C# moderator but also a C++ user :} The ipch directory > and the many, many new files generated by the compiler can be safely > deleted. In fact they should be deleted (and probably are) for clean > builds. I teach a C++ college class myself and here is what I require > my students to do. >
1.In the solution folder delete all bin, obj, ipch, debug and release directories. >
2.Delete any .suo files > 3.Delete any .user files > 4.Delete any .ncb files > 5.Delete any .sbr files > 6.Delete any .*log files (for VS 2010)

I've had no issues following the given steps.

(Source and original post)

Update:

raphinesse has also linked to a question which states that the .SDF file can be removed safely as well.

Solution 2 - Visual Studio-2010

I was bothered by my 'ipch' folder and deleted it. When you open the project again the 'ipch' folder is recreated. Runs just like before.

Solution 3 - Visual Studio-2010

Yes, it is safe - all that is in this gitignore file is safe to remove: https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

Solution 4 - Visual Studio-2010

There are a number of files that Visual C++ uses temporarily that can freely be deleted. Most of them will automatically be recreated the next time you load the project, while the others will be regenerated the next time you build your project.

I have found the need to prune these files out for zipping and sharing online, so I wrote this utility for pruning the temporary files.

In direct answer to the question, the answer is yes.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJamie KeelingView Question on Stackoverflow
Solution 1 - Visual Studio-2010Jamie KeelingView Answer on Stackoverflow
Solution 2 - Visual Studio-2010glrView Answer on Stackoverflow
Solution 3 - Visual Studio-2010canesinView Answer on Stackoverflow
Solution 4 - Visual Studio-2010SerapthView Answer on Stackoverflow