views:

1618

answers:

5

Does anyone know how to tell VS(2008) where to save the obj folder when building the solution? We have it save the bin folder to another path in order to keep the source file folders small (ie. emailable), but can't find any way to tell it to do the same with obj...

Thanks!

+1  A: 

It's the Output Directory under Properties > General of the project settings.

Edit: it seems like there is a difference between the project settings for native C++ projects (which I'm using) and CLR based projects (which might be what the OP is referring to).

fhe
This is only for "bin" directory. Not for "obj".
TcKs
I've set both Output Directory and Intermediate Directory to a specific path and all *.obj files are stored at this location.
fhe
A: 

Unfortunately, there is no way, how to do this :/.

But, you can use a "Clean solution" command for delete this directory. Also if you use some version control, the "obj" directory will not be component of files in repository.

TcKs
+9  A: 

Use the BaseIntermediateOutputPath property in the project file (.csproj, .vbproj, etc.), as explained at http://msdn.microsoft.com/en-us/library/bb629394.aspx. You'll have to manually edit the XML document using a text editor, then reload it in Visual Studio. It may still create the obj folder (that's a known bug), but will leave it empty and put the actual obj files in your specified folder.

Sören Kuklau
As an addition, if you have the Visual Studio Power Commands installed (available from http://code.msdn.microsoft.com/PowerCommands), you can edit the project file within Visual Studio (right-click, Edit project file). +1 for the link and the bug note.
OregonGhost
+3  A: 

Do you use version control? If you do, there's an alternative:

You can exclude bin/ and obj/ from version control and check out your project instead of e-mailing. If you use Subversion, you could also Export your project and e-mail the exported and zipped folder.

Alexander Kojevnikov
A: 

1.) You add this to your project file below tag:

<IntermediateOutputPath>..\Whatever\obj\</IntermediateOutputPath>

2.) VS will still create obj folder , so you have to delete it every time after a build. This can be done: Put this to post-build script:

rd "$(ProjectDir)obj" /S /Q
Galaris