How to “get rid of” $(SolutionDir) when building Visual Studio project from outside Visual Studio

后端 未结 3 1605
粉色の甜心
粉色の甜心 2021-02-04 00:28

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 onl

3条回答
  •  我在风中等你
    2021-02-04 01:16

    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.

提交回复
热议问题