Skip to content

Instantly share code, notes, and snippets.

Created April 14, 2020 23:12
What would you like to do?
Get server URLs in .NET Core 3.1 app
public static async Task Main(string[] args)
var host = CreateHostBuilder(args).Build();
var task = host.RunAsync();
var serverAddresses = host.Services.GetRequiredService<IServer>()
foreach (var serverAddress in serverAddresses.Addresses)
await task;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment