Avatar ·

Reading settings from app.config or web.config in .NET: step-by-step guide for beginners

Hello everyone! I'm a beginner in C# and .NET, and I'm having trouble reading settings from configuration files.\n\nI have a console application where I want to store a database connection string and several custom parameters (e.g., timeout and log path) in the app.config file. I added this file to the project, but I can't figure out how to correctly read the values from it.\n\nHere's my app.config:\n\n```xml\n\n\n \n \n \n \n \n\n```\n\nI tried writing code like this:\n\n```csharp\nstring connS