Fortunately Microsoft knows how to respond with the right solutions to problems, and the acceleration of the pace of releases allows us to benefit from new features much more often.
In this article, I would like to present to you how to read and define the values of environmental variables from a plugin C#.
In fact, the environment variable feature does not come in a single table, but in two tables :
- Environment Variable Definition
- Environment Variable Value
When you create a new Environment Vaiable in your solution, this actualy creates the environment variable Définition. Which can be deployed later with you solution. If you want to maintain different values for all environments the definition is enought to be imported in the solutions. You probably won't need to deploy the values.
The code below will help you initiate and set the variable values in the target environment.