Je vois qu'il existe des moyens d'obtenir le chemin du dossier d'application:
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)
Quelle est la meilleure façon selon la situation?
IHostEnvironment.ContentRootPath, accessible via une IHostEnvironmentdépendance injectée (qui contient d'autres choses utiles).