Skip to content

Instantly share code, notes, and snippets.

@ericstj
Created January 6, 2020 17:17
Show Gist options
  • Save ericstj/20497889f9d71ceb5d0f5fcc84cdede1 to your computer and use it in GitHub Desktop.
Save ericstj/20497889f9d71ceb5d0f5fcc84cdede1 to your computer and use it in GitHub Desktop.
appsettings
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
</ItemGroup>
</Project>
using System;
namespace appsettings
{
class Program
{
static void Main(string[] args)
{
System.Configuration.ConfigurationManager.AppSettings["hello"] = "world";
Console.WriteLine("Hello World!");
Console.WriteLine(System.Configuration.ConfigurationManager.AppSettings["hello"]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment