VS2010 Build Log File is Incorrect

719 Views Asked by At

My VS2010 C++ project, release config, has an Output Directory of:

$(SolutionDir)\..\_build\Release\

The Intermediate Directory is:

$(SolutionDir)\..\_build\Release\Obj\$(TargetName)\

The Build Log File is just the default setting:

$(IntDir)\$(MSBuildProjectName).log

However, the build log file is not being written where I expect it to be. It is instead being written to:

$(SolutionDir)\_build\Release\Obj\$(TargetName)\$(MSBuildProjectName).log

It's as if the .. is being stripped from the path when writing the log file. However, all other intermediate files are written to the correct directory.

Is the log writer altering my path? It seems to be 90% correct, but it's missing a vital ... Is there anything I need to do to get it to read correctly?


Update:

After playing around with it, I've discovered that IncrediBuild is causing the problem. Building without IncrediBuild puts the log file in the correct place, but with IncrediBuild the log file is going into the wrong directory.

2

There are 2 best solutions below

1
On

Try

<Path>$(SolutionDir)..\Output\$(ProjectName).log</Path>

It works for me. SolutionDir already has a \ on the end so you end up with \\ in the path, which I think is the problem.

0
On

Okay, say if I want to put the log file in the Output folder that is one level higher than the current solution file location, like this:

MyTestProject
    |___ MyTestProject.sln
    |___ MyTestProjectFolder
    |___ Debug
Output
    |___ MyTestProject.log

In the vs 2010 project file, instead of using:

<BuildLog>
  <Path>$(SolutionDir)\..\Output\$(ProjectName).log</Path>
</BuildLog>

I have to use:

<BuildLog>
  <Path>$(SolutionDir)\..\..\Output\$(ProjectName).log</Path>
</BuildLog>

This is a little bit weird because I don't have to use 2 ".." for all the other paths, like OutDir and IntDir. I will update this answer if I find anything further.