Is there a way to tell Visual Studio to use a different location for the bin and obj directories?
For example, if my project is in C:\my\myprojects.csproj, how can I have the obj and bin directories in, say, D:\otherdirectory\bin and D:\otherdirectory\obj. The Visual Studio project option offer only to redirect the bin directory, not the obj directory.
Also, bonus question: Can I use environment variables, not full or relative paths?
Is this possible?
Refer to this article and use the nodes BaseOutputPath (for the
binfolder) and BaseIntermediateOutputPath (for theobjfolder) in the .proj file.Given below is a way to modify your debug and release folders relative to
bin–In Solution Explorer, select the C# project you want to configure
build parameters on.
Next, from the Visual Studio menu bar, select Project → Properties. The Property Pages dialog will appear for your project.
Choose the Configuration (Release/Debug) you want to change and expand the Configuration Properties node in the left hand pane. Select the Studio is placed in the “Output path” attribute of the Outputs
property sheet.
Be aware that the output path is specified separately for each kind of
build configuration, and that setting it on one configuration doesn’t
set it on all the remaining ones.
Original source – http://www.eggheadcafe.com/software/aspnet/32040244/how-to-change-the-obj-folder.aspx