アプリケーションフォルダーのパスを取得する方法はいくつかあります。
Application.StartupPathSystem.IO.Path.GetDirectoryName( System.Reflection.Assembly.GetExecutingAssembly().Location)AppDomain.CurrentDomain.BaseDirectorySystem.IO.Directory.GetCurrentDirectory()Environment.CurrentDirectorySystem.IO.Path.GetDirectoryName( System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)System.IO.Path.GetDirectory(Application.ExecutablePath)
状況に応じて最適な方法は何ですか?
IHostEnvironment.ContentRootPath、注入されたIHostEnvironment依存関係(他の有用なものを含む)を介してアクセスされる信頼性の高いが得られました。