「[[Open棟梁 wiki>https://opentouryo.osscons.jp]]」は、「[[Open棟梁Project>https://github.com/OpenTouryoProject/]]」,「[[OSSコンソーシアム .NET開発基盤部会>https://www.osscons.jp/dotNetDevelopmentInfrastructure/]]」によって運営されています。 -[[戻る>.NET Core対応]] *目次 [#o78d1d8c] #contents *概要 [#wc473723] .NET Core対応で初期化処理が必要になった点がいくつかあるのでメモ。 *詳細 [#bee65ff9] **共通 [#v893873f] *** [#nd9f34e6] **ASP.NET Core [#ebe5b258] ***カレント・ディレクトリ [#a948f331] -ASP.NET Coreでは、[[Docker対応]]などで、相対パスを使用するケースが増えてきた。 -そこで、必要に応じて以下の様に、カレント・ディレクトリを変更する。 // カレント・ディレクトリを変更する。 Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)); ***HttpContext.Current [#t6a0097d] HttpContext.Currentを使用可能にする。 // HttpContextのマイグレーション用 services._AddHttpContextAccessor(); ※ 利用の際は、 MyHttpContext.Current.Session >等として利用する。 ***OAuth2 & OIDC Client [#xad90b6d] これは、.NET Framework版でも必要。 // OpenID用 OAuth2AndOIDCClient.HttpClient = new HttpClient(); *参考 [#d06435a8]