I currently have the following MSBuild command:
msbuild /t:Build /p:Configuration=Release /p:OutputPath=C:\MySolutionOutput\ MySolution.sln
In compilation, however, I have several projects in my solution. When I do the assembly in this way with the solution file, it copies all the outputs of the project to the same directory, and the output from Project2 overwrites the output of Project1 (or no matter what order it is built in).
Instead, I want MSBuild to put each project in a subfolder of the project name.
msbuild /t:Build /p:Configuration=Release /p:OutputPath=C:\MySolutionOutput\$(ProjectName) MySolution.sln
However, the syntax for $(ProjectName) does not work, because it literally creates a folder named $ (project_name).
How can I create an MSBuild solution for outputting each project to the OutputPath subdirectory, preferably without creating MSBuild xml files or for creating each project separately?
To illustrate this, my projects are as follows.
+ Project 1 + File1.txt + File2.txt + ReadMe.txt + Project 2 + File3.txt + File4.txt + ReadMe.txt
What are my build outputs
C:\MySolutionOutput\File1.txt C:\MySolutionOutput\File2.txt C:\MySolutionOutput\File3.txt C:\MySolutionOutput\File4.txt C:\MySolutionOutput\ReadMe.txt ^-- (this is the 2nd readme, project 1 readme gets overwritten)
What I want
C:\MySolutionOutput\Project 1\File1.txt C:\MySolutionOutput\Project 1\File2.txt C:\MySolutionOutput\Project 1\ReadMe.txt C:\MySolutionOutput\Project 2\File3.txt C:\MySolutionOutput\Project 2\File4.txt C:\MySolutionOutput\Project 2\ReadMe.txt