Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Is there a way to get the web app domain in Main() (program.cs)?

$
0
0

When my application starts I want to have it create the sitemap.txt dynamically. Doing so requires I have the domain of the website which differs for the dev and production slots.

Is there a way to get this in Main()? I think logically that should be known by the system. But Blazor only has NavigationManager and that service appears to only be available in the context of a page.

If not, I can stuff the value into a singleton service when the first page loads and then have a BackgroundService create the files. Asking here to avoid all that.

Update: The specification for a sitemap.txt is here (along with the spec for sitemap.xml).


Viewing all articles
Browse latest Browse all 4839

Trending Articles