8

Is it possible to create a targeted OBJ file path much like you can do for a BIN folder? You can set the output path in the Project's properties. Example paths would be: Bin\Debug\Windows Phone 7\ Bin\Debug\NETMF\ Bin\Debug....\

A use case here is if I have multiple projects that target different platforms. On compiling, the OBJ file is shared instead of separated out like the bin folders are. When compiling, you hit race conditions where the OBJ folder is being leveraged at the same time and errors are thrown.

Den
  • 16,686
  • 4
  • 47
  • 87
Clint Rutkas
  • 280
  • 2
  • 8
  • Not sure but I will have to follow this one... I hate when I dev on Dropbox/SkyDrive on different drive letters and so symbols don't resolve unless I rebuild, etc. – Jeff Wilcox Sep 29 '12 at 21:08

1 Answers1

7

Here we're talking about MSBUILD, and you have the option of setting BaseIntermediaryOutputPath in your project. If you open the project (.csproj, I am assuming) with an XML editor, you will see configuration blocks for different debug/release config combos.

So something like this (edit for each config option separately):

<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{A35097D8-80BC-4FA5-BECD-FF045C5566EC}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>WorkApplication</RootNamespace>
    <AssemblyName>WorkApplication</AssemblyName>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <BaseIntermediateOutputPath>E:\OBJ-TEST</BaseIntermediateOutputPath>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
Den
  • 16,686
  • 4
  • 47
  • 87
  • 3
    Things to note here, you have to do this for every configuration in that project file. Release, Debug, Arm, .... – Clint Rutkas Sep 29 '12 at 21:28
  • 4
    also note http://msdn.microsoft.com/en-us/library/bb629394.aspx for additional msbuild properties in the project file – Clint Rutkas Sep 29 '12 at 21:41