Getting rid of C#’s obj folders

A small tip for developers who are irritated with Visual Studio doing this to your pristine source tree:

Why Visual Studio, WHY?!
obj folders mucking up your day

To get the obj directories out of your source tree, and somewhere nicer (your project’s build output directory for example) open up your project’s .csproj file in an external editor. Locate any line that has the <OutputPath> tag on it. On the line below, insert the following:

<IntermediateOutputPath>the\path\you\want</IntermediateOutputPath>

For example, in my Dungeon Crawler project I have the following in Dungeon Crawler Shared.csproj

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\..\build\any\Debug\</OutputPath>
	<IntermediateOutputPath>..\..\build\obj\any\Debug</IntermediateOutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <DocumentationFile>..\..\build\obj\any\Debug\ScottCommon.xml</DocumentationFile>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>..\..\build\any\Release\</OutputPath>
	<IntermediateOutputPath>..\..\build\obj\any\Release</IntermediateOutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <DocumentationFile>
    </DocumentationFile>
  </PropertyGroup>

Hope that helped!