title: .NET core Pass Commandline Args to Startup.cs from Program.cs
body: <p>I'm trying to configure kestrel so that when it's in it's raw mode it runs on a specific port. However to do so it appears that the launchsettings.json needs to pass command line args to do so since there is no straight up option and it always runs on port 5000 which will obviously conflict if you have an api you need to run and a website.</p>
  
  <p>So I added the CommandLine package to my site and you can indeed use builder.AddCommandLine() in the startup.cs file.</p>
  
  <p>The problem is how to get the args from the program.cs to the Startup.cs or look them up other than a static variable.</p>
  
  <p>Kind of makes the extension method pointless if you can't get at the args. </p>
  
  <p>Any better ways of doing this?</p>