© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
1 reply
İrşat

Environmental Variables in VS 2022 [Answered]

{
  "profiles": {
    "Library.Dependency": {
      "commandName": "Project",
      "environmentVariables": {
        "MyLibs": "C:\\MyProject",
        "Configuration": "Release"
      }
    }
  }
}
{
  "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>
  <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>
<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.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Rider not working after running repair on VS 2022 [Answered]
C#CC# / help
4y ago
VS: Removing this "directives" {} on VS 2022
C#CC# / help
2y ago