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

**URL:** https://discuss.elastic.co/t/how-to-config-elastic-agent-in-windows-form-net-framework-4-8-without-system-variables/317639
**Category:** Elastic Agent
**Tags:** language-clients
**Created:** [October 27, 2022, 6:28pm UTC](https://discuss.elastic.co/t/how-to-config-elastic-agent-in-windows-form-net-framework-4-8-without-system-variables/317639 "2022-10-27T18:28:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![AUnkownS](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@AUnkownS](https://discuss.elastic.co/u/AUnkownS)
#### Post date: [October 27, 2022, 6:28pm UTC](https://discuss.elastic.co/t/how-to-config-elastic-agent-in-windows-form-net-framework-4-8-without-system-variables/317639/1 "2022-10-27T18:28:14Z")

</div>

Hello,

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:

```auto
 AgentComponents ac = new AgentComponents();             
                ac.Service.Name = "Something";
                ac.Service.Environment = "dev";
                Agent.Setup(ac);

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [November 24, 2022, 6:28pm UTC](https://discuss.elastic.co/t/how-to-config-elastic-agent-in-windows-form-net-framework-4-8-without-system-variables/317639/2 "2022-11-24T18:28:19Z")

</div>

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