Pass command-line arguments to Startup class in ASP Core
问题 I have arguments passed in via the command-line private static int Main(string[] args) { const string PORT = "12345" ; var listeningUrl = $"http://localhost:{PORT}"; var builder = new WebHostBuilder() .UseStartup<Startup>() .UseKestrel() .UseUrls(listeningUrl); var host = builder.Build(); WriteLine($"Running on {PORT}"); host.Run(); return 0; } One of these arguments is a logging output directory. How do I get this value into my Startup class so I can write out to this directory when I