I have a number of projects that are combined into a solution. Each project has its own directory structure, and csproj files are located at different levels of the folder structure. Each csproj has an OutputPath property. OutputPath is a relative path and varies from project to project so that all projects have the same output directory. It works fine if I create a separate project. But everything changes if I try to create a solution file. In this case, each project output folder is different (depends on the number of ".." in this OutputPath project).
I know that until that moment everything worked fine. No one changed build.cmd to either the sln or csproj files. But now I have the situation described above.
So my question is: what affects the estimation of the relative path? I mean, how can I get the relative OutputPath to be evaluated, starting from the folder where the csproj file of this particular project is located. Not from the folder where the .sln file is located.
Let assume I have following directory structure: dir1 a.sln dir2 a.csproj dir21 dir3 b.csproj
a.csproj has an output path set to "../../_bin", which is located just above dir1, if calculated from the a.csproj folder b.csproj has an output path set to "../../ .. / _bin ", which is the same - only near dir1 if counted from b.csproj
a.sln contains both a.csproj and b.csproj.
When I run msbuild, I get the project assembly in 'dir1 /../../_ bin' and b project to 'dir1 /../../../_ bin' - both relative paths of the project files are calculated from the location solution file, not project files.
source share