Ich sehe, dass es einige Möglichkeiten gibt, den Pfad des Anwendungsordners abzurufen:
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)
Was ist je nach Situation der beste Weg?
IHostEnvironment.ContentRootPath, Zugriff über eine injizierte IHostEnvironmentAbhängigkeit (die andere nützliche Dinge enthält).