Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Visual Studio - obj folder file

Posted on 2013-05-22
8
Medium Priority
?
803 Views
Last Modified: 2013-05-30
Is there a way to tell Visual Studio to delete the intermediate obj files after a successful build?
0
Comment
Question by:HLRosenberger
  • 3
  • 3
  • 2
8 Comments
 
LVL 35

Expert Comment

by:sarabande
ID: 39190033
you probably could do it by defining an appropriate postbuild event step.

but why would you do that? deleting the obj modules would make the executable out-of-date cause the input files for the build were no more available. so every time later you have to make a full build and when you start the program from visual studio you always was asked whether to make a new build.

Sara
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 39190756
I thought the obj files are intermediate files the get used during the build, and the final build files are created in bin?
0
 
LVL 35

Expert Comment

by:sarabande
ID: 39191007
yes. you are right. you don't need the obj files for execution.

but the build process would make an incremental build (beside you make a rebuild or clean before build). and when invoking from visual studio the obj files were checked whether they have a timestamp older than the executable. if you delete all those files you would get a warning that your program is not up-to-date because of this.

why do you want to delete the files?

Sara
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 40
ID: 39197920
I would not do it.

The obj folder is used internally by Visual Studio during the build process. If you delete it, you will eventually end up with slower builds because some of the files in there are being reused build after build. If you delete them, the compile will need to recreate them or copy them again each time you compile.

For intance, if you use a COM dll in your application, the interop dll needed for a VB.NET application in order to connect to COM will have to be recreated everytime, and this be time consuming if the COM dll is a big one.

The only thing you can gain from that is to save some space on the hard disk.
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 39208151
Maybe I did not ask the question correctly.  I do not want to delete the folder.  I do not want to delete any  intermediate file.   I have a couple DLL project.   After building, I always end up with 2 identical copies of the DLL - one in bin and one in obj.    Then we back up our source code project, we are backing up the obj folder because it's a subfolder.  I just did not want to backup the DLL in the obj folder.  We end up with copies
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 1000 total points
ID: 39208184
Most backup software have a way to exclude directories and/or specific files. You could use that feature on the software you use.

Personnally, I do not backup .exe, .dll and .pdb files from my projects, since these are recreated upon compilation. As long as I have the source code, I am OK.
0
 
LVL 35

Assisted Solution

by:sarabande
sarabande earned 1000 total points
ID: 39209045
the copy of the dll was done by a post-build event configured in your project settings.

rather then doing a backup after build i would recommend to putting all sources to source control. you could use visual sourcesafe or - better - subversion which is freeware. th ebackup then can be an additional means, which actually shoulkdn't much care for duplicates but should make an image of the current development such that it could be recreated within short time when a ahrdware or severe software error has damaged the current environment.

generally, no temporary files and user-profile files should be added to source control. that includes all but the source files as recommended by James.

if you have all sources under source control, you have an additional restore chance. simply get all youngest sources back from source control and make a rebuild. that will in most cases be first choice over doing a restore from backup.

Sara
0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 39209071
Thanks
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question