I want to build a .vcxproj via MSBuild from outside Visual Studio. The problem is that there are many occurrences of $(SolutionDir) inside the .vcxproj file which apparently only get set correctly when the solution is loaded.
When I replace $(SolutionDir) with the actual absolute path, it works. But other people on other machines are working with the same project file, so this is not a solution.
Is there a solution or hack to solve this problem?
In Visual Studio, click Tools > Options. Expand Projects and Solutions and click Locations. The Projects location field defines the default location for storing new projects. You can change this path if you are using a different working folder.
You can set the variable by passing parameter arguments:
/p:SolutionDir=path
So, rather than editing the solution file, you can create a build script that sets up the environment and executes MSBuild accordingly, leaving the Visual Studio file as is for development work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With