Is there a way to get the URL from program.cs file?
I've seen an option with @inject NavigationManager MyNavigationManager but it is for components.
Is there a way to get the URL from program.cs file?
I've seen an option with @inject NavigationManager MyNavigationManager but it is for components.
So is this Blazor server-side or client-side? If it's client-side you can use the IWebAssemblyHostEnvironment to get the url. You can try this:
private static void ConfigureServices(IServiceCollection services, IWebAssemblyHostEnvironment hostEnvironment)
{
var baseAddress = hostEnvironment.BaseAddress;
}