Managed World

An Odyssey Through The Land Of Geekdom With jolson88

  Home  |   Contact  |   Syndication    |   Login
  472 Posts | 0 Stories | 334 Comments | 1295 Trackbacks

News

Twitter












Archives

Post Categories

Blog Roll

[Crosspost from Managed World]

As I've mentioned in a previous article, I was annoyed with Visual Studio .NET 2002/2003 and the fact that you can't change the obj directory. I'm a stickler for keeping my src directory clean. My annoyance was due to the fact that you could _not_ change the directory the intermediate files for C# were saved to. Well, I'm pleased to announce that it appears it has now changed.

You can change the "BaseIntermediateOutputPath" value in your MSBuild file and that will change where the intermediate files are created. Thanks Microsoft :). I can now have the exact directory structure I want without it being dictated to me by Microsoft. It's about time :).

Thanks go to Day Dreamer who pointed this out to me as a comment to the earlier post linked to above.

posted on Saturday, March 11, 2006 7:35 PM

Feedback

# re: Changing the obj directory in .NET 2.0 7/26/2006 4:30 PM Young Methusaleh
I find that if you override BaseIntermediateOutputPath in the proj files then rebuilds will fail when run inside the IDE if the default obj\debug folder does not exist. Of course the IDE does not write any file to the default obj folder, it just fails if they are not there. The really bad news is that the IDE will still create the obj folder when you reopen a project anyway...
If anyone knows how to make the IDE work properly then I would love to know about it..

# re: Changing the obj directory in .NET 2.0 10/31/2006 7:05 AM EricP
Methusaleh, I have the same problem than you, the obj folder is always recreated when I reopen the project. Could you solve this problem ?

Thanks,
Eric

# re: Changing the obj directory in .NET 2.0 8/29/2007 10:30 AM Pradeep Prabhakar
You can add a BaseIntermediateOutputPath tag under each of the target platform property groups. <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<BaseIntermediateOutputPath>myLibrary\obj\Debug</BaseIntermediateOutputPath>

Visual studio csproj files are msbuild files and should take most of the msbuild options

# re: Changing the obj directory in .NET 2.0 4/23/2009 11:42 PM Pradeep
The really bad news is that the IDE will still create the obj folder when you reopen a project anyway. If anyone knows how to make the IDE work properly then I would love to know about it.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: