I am having difficulty using ConfigurationManager in my C# code. I have tried various solutions but have not been successful. I am also unable to add a reference. Can someone provide guidance on how to use ConfigurationManager properly?
Strange, could you try removing using Microsoft.Extensions.Configuration from the top? That namespace also defines ConfigurationManager so I would expect an error message to tell you that it's ambiguous rather than the error in your original post.
Edit: Ah, just re-read your original post. There's a typo - it's ConfigurationManager rather than ConfigrationManager.
I am trying to solve it for a few hours actually I want to fetch some data from a txt file that is present in the folder of my console app and before my app starts I want to load all words from txt file to a list I was doing it through hard coding way but someone told me to do it through app.config this isn't working can you recomend me somethimg else??
Reading these values from a text file is fine for this case. You don't necessarily need to store the filename in your app.config, you could just hard-code the file path in your app, but it does give you flexibility for the file name to be configurable. If you fix that ConfigurationManager typo it should work.