Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

creating a targeted OBJ folder for a project in Visual Studio

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.

like image 664
Clint Rutkas Avatar asked Sep 29 '12 21:09

Clint Rutkas


1 Answers

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>
like image 70
Den Delimarsky Avatar answered Oct 03 '22 21:10

Den Delimarsky