How can I add File paths in app.config
and then use the file path in c# Project as one of my requirements in project is not to hardcode file paths in .cs
file.
CodePudding user response:
You can configure User-scoped and Application-scoped settings by using the properties pages of your project. More details here:
If you haven't yet created a settings file click on the link in the middle of the page. After doing so the page should look like in the following screenshot and you should be able to create new settings:
In this example I created an application-scoped setting called "SomeSetting" with a value of "C:\SomeDir". This setting can later be accessed using:
var s = Settings.Default.SomeSetting;