Solved

Visual Studio - obj folder file

Posted on 2013-05-22
8
743 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 33

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 33

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
 
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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 250 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 33

Assisted Solution

by:sarabande
sarabande earned 250 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

910 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now