Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure the intermediate output directory in C#

I'm trying to organize my workspace and want my intermediate objects to be put in the ..\build\obj folder in relation to my .csproj file. So I put:

<IntermediateOutputPath>..\build\obj\Debug</IntermediateOutputPath>

in the .csproj file. The intermediate objects are now put in that location when the solution is built, but the problem is that an obj directory is still created in the directory the .csproj file is in (something to the effect of obj\Debug\TempPE) when the solution is opened. What is this directory for, and how can I relocate it?

like image 893
blachniet Avatar asked Jul 22 '10 16:07

blachniet


People also ask

How do I change the build directory output?

Right-click on the project node in Solution Explorer and select Properties. Expand the Build section, and select the Output subsection. Find the Base output path for C#, and type in the path to generate output to (absolute or relative to the root project directory), or choose Browse to browse to that folder instead.

What is an output directory?

output directory. [ESRI software] In ArcIMS, the folder designated during installation to hold files being served to users for display in a browser.

How do I change the target path in Visual Studio?

You can open *. csproject file with any text or XML editor, change the wrong path, then save the file. Then re-open the project with Visual Studio again.


2 Answers

You could try to do this (don't forget that there are Debug and Release sections which will be used depending on what type of build you are targeting):

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">     ...     <BaseIntermediateOutputPath>..\build\obj</BaseIntermediateOutputPath>     <IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">     ...     <BaseIntermediateOutputPath>..\build\obj</BaseIntermediateOutputPath>     <IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath> </PropertyGroup> 
like image 53
Darin Dimitrov Avatar answered Oct 04 '22 07:10

Darin Dimitrov


Do this like Microsoft:

  <PropertyGroup>     <IntermediateOutputPath Condition=" '$(PlatformName)' == 'AnyCPU' ">$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>     <IntermediateOutputPath Condition=" '$(PlatformName)' != 'AnyCPU' ">$(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\</IntermediateOutputPath>   </PropertyGroup> 
like image 23
Brans Ds Avatar answered Oct 04 '22 09:10

Brans Ds