Defining Project Paths in a Solution via Macro/Environment Variable

前端 未结 2 2152
独厮守ぢ
独厮守ぢ 2021-02-13 16:20

Is there a way to define the project file path in a solution using a user macro/environment variable? I can\'t seem to do that.

Kind of like an environment variable is u

相关标签:
2条回答
  • 2021-02-13 16:37

    In .sln file use syntax "%ENV_VAR%rest_of_the_path\test.csproj"

    In .csproj file use syntax "$(ENV_VAR)rest_of_the_path\test.dll"

    That works for me, ENV_VAR is custom environment variable defined for operating system like ENV_VAR = "C:\MyPath\"

    0 讨论(0)
  • 2021-02-13 16:45

    MSBuild allows you use to environment variables,

    http://msdn.microsoft.com/en-US/library/ms171459(v=VS.80).aspx

    So that you should be able to define environment variables as you wish, and then modify vCxproj files to make use of them.

    I am not sure if that tip works for sln files, as sln files are not MSBuild scripts.

    0 讨论(0)
提交回复
热议问题