C#C
C#4y ago
İrşat

Environmental Variables in VS 2022 [Answered]

{
  "profiles": {
    "Library.Dependency": {
      "commandName": "Project",
      "environmentVariables": {
        "MyLibs": "C:\\MyProject",
        "Configuration": "Release"
      }
    }
  }
}

I am trying to get those environmental variables and write them here;
  <PropertyGroup>
    <OutputPath>$(MyLibs)\\$(Configuration)</OutputPath>
    <Company>Software</Company>
    <Authors>Software</Authors>
  </PropertyGroup>

I realized that VS 2022 doesn't support this. So I experimented and used windows environmental variables instead. Mission accomplished unsuccessfully.
<OutputPath>%MyLibs%</OutputPath>

It finally shows something else than just C:\Debug. It doesn't work regardless. How do I do this normally? Oh and it would be nice if I could reach this damn thing from the entire project. There is one main project and some dependencies. All uses these.
Was this page helpful?