How to Config Elastic Agent in Windows Form .NET framework 4.8 without System variables


I am trying to config a elastic agent in a windows desktop application(winforms) in the .NET framework 4.8. My goal is to change the Agents Url and Service name, without having to use environment variables. I tried using Agent.Setup with Agent Components and putting the config details in app.config file in the , but no success. The Agent seems to ignore the app.config file and use the default values.

Does anyone know a way I could modify the Agents config without having to use the app or environmental variables. and also I was wondering if there was any resources on how to config an Agent in windows desktop application in .NET framework 4.8?

Some code I tried:

 AgentComponents ac = new AgentComponents();             
                ac.Service.Name = "Something";
                ac.Service.Environment = "dev";

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.