I started using Visual Code instead of VS- Unfortunately, I can’t figure out how to setup appSettings.config and reference the key values using Configuration Manager.
This line throws a Nullreference exception:
var applicationId = ConfigurationManager.AppSettings["appId"].ToString();
I manually added the file appSettings.config when I created the console application. Here’s the Folder structure:
Is there additional configuration needed?
2
Answers
I needed to rename appsettings.config to app.config.
Why don’t you use Visual Studio 2022 where all of that is in the box?