I'm trying to reference a C# DLL project from another solution, but the build is generating the DLL in a very strange output folder.
The directory contents is this:
c:\a\b\c\src\Solution.sln
c:\a\x\y\z\MyDLL\MyDLL.csproj
The MyDLL.csproj
does not have an <OutputPath> tag. It does however have a <SolutionDir> tag that I don't see often.
The computed output path, as shown in Properties view, happens to be:
..\..\..\..\b\c\src-z\MyDLL\objd\i386
This corresponds to this path:
c:\a\b\c\src-z\src\MyDLL\objd\i386
which is very weird, since I'm not aware of anything in configuration with src-z. Is Visual Studio computing a path with hyphens?
I want to fix this, possibly changing the <SolutionDir>, but I don't want to break other solutions.
The computation seems to happen very early in the build process, as the first thing the builder logs is:
1>Project 'MyDLL (x\y\z\MyDLL\MyDLL.csproj)' is not up to date.
Input file 'x\y\z\MyDLL\MyDLL.csproj' is modified after output
file 'c:\a\b\c\src-z\src\MyDLL\objd\i386\MyDLL.pdb'.
So what algorithm is Visual Studio using to compute the output path when a project <OutputPath> tag is not found?
I found the issue. One of the referenced projects was defining <BaseIntermediateOutputPath> as
$SolutionDir + "-" + $ProjectName
, which yields toc:\a\b\c\src-z
.As for answering my question, the best I could deduce is: