Как настроить и прочитать настройки приложения при создании проекта в Visual Code?C#

Место общения программистов C#
Гость
Как настроить и прочитать настройки приложения при создании проекта в Visual Code?

Сообщение Гость »


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?


Источник: https://stackoverflow.com/questions/781 ... isual-code

Вернуться в «C#»