Saya melihat bahwa ada beberapa cara untuk mendapatkan jalur folder aplikasi:
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)
Apa cara terbaik tergantung pada situasinya?
IHostEnvironment.ContentRootPath, diakses melalui IHostEnvironmentketergantungan yang disuntikkan (yang berisi hal-hal berguna lainnya).