*初期化時に 以下を実行
** System.Text.Encoding.RegisterPro[[vi]]der(System.Text.CodePagesEncodingPro[[vi]]der.Instance);
==Console==
===設定ファイル===
<pre>
dotnet add package Microsoft.Extensions.Configuration.Json --version 5.0.0
</pre>
<pre>
using System;
using System.IO;
using Microsoft.Extensions.Configuration;
namespace docweb_bat
{
public class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
IConfiguration configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", true, true)
.Build();
IConfigurationSection section = configuration.GetSection("DocumentWebDatabaseSettings");
string str = section["DocumentWebCollectionName"];
Console.WriteLine(str);
}
}
}
</pre>