「Open棟梁 wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。
.NET Core対応で初期化処理が必要になった点が幾つかあるのでメモ。
GetConfigParameterクラス利用時の初期化処理。
public Startup(IHostingEnvironment env, IConfiguration config) { ... GetConfigParameter.InitConfiguration(config);
GetConfigParameter.InitConfiguration("appsettings.json");
// カレント・ディレクトリを変更する。 Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location));
HttpContext?.Currentを使用可能にする。
// HttpContextのマイグレーション用 services._AddHttpContextAccessor();
※ 利用の際は、
MyHttpContext.Current.Session
等として利用する。