Visual Studio keeps adding property to my csproj. Why?

.net, csproj, msbuild, visual-studio, visual-studio-2012

Solution

Those IntermediateOutputPath's can be inserted when MSBuild is given a bad path.

In our case, we had extra unnecessary slash after SolutionDir for output folders.

What wasn't working for us(note the extra slash):

<OutputPath>$(SolutionDir)\out\bin\</OutputPath>
<IntermediateOutputPath>$(SolutionDir)\out\obj\</IntermediateOutputPath>

What did work:

<OutputPath>$(SolutionDir)out\bin</OutputPath>
<IntermediateOutputPath>$(SolutionDir)out\obj</IntermediateOutputPath>

To help troubleshoot your particular case, try turning on diagnostic MSBuild output and logging under Tools->Options->Projects and Solutions->Build and Run-> MSBuild project build output verbosity. Then, search for the generated folder (ex. "Temp").

Using common proj/props/targets file is a great idea, but it does require fighting Visual Studio a little.

Problem

I'm using Visual Studio 2012 RC to work with my C# solution. All my configuration-specific settings are stored within a single .props file which is then included by all my .csproj files. Yet VS insists on putting this right in front of the include: ``` <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> <IntermediateOutputPath>C:\Users\xyz\AppData\Local\Temp\vs855E.tmp\Debug\</IntermediateOutputPath> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"> <IntermediateOutputPath>C:\Users\xyz\AppData\Local\Temp\vs855E.tmp\Release\</IntermediateOutputPath> </PropertyGroup> <Import Project="$(MSBuildProjectDirectory)\..\Common.props" /> ``` Why is that? FYI, my common file looks like this: http://pastebin.com/Uued1XY0

Original source

Related problems