I'm altering a large Blazor server-side app which was originally developed under IIS Express (with localhost etc) to support deployment to an IIS virtual directory. Parts of the app have data-driven navigation where pages are referenced just as they're declared in the @page directives (e.g. /mycontent). We've specified the virtual directory in startup with UsePathBase so we were surprised when calls like this ignore the base:
NavManager.NavigateTo("/mycontent", forceLoad: true);
Instead of https://site.com/virtualdir/mycontent it navigates to https://site.com/mycontent which 404s.
It's easily fixed, but is this intentional, or is this a bug?
(Edit: Probably worth noting that ToAbsoluteUri also ignores the base.)
I'm altering a large Blazor server-side app which was originally developed under IIS Express (with localhost etc) to support deployment to an IIS virtual directory. Parts of the app have data-driven navigation where pages are referenced just as they're declared in the
@pagedirectives (e.g./mycontent). We've specified the virtual directory in startup withUsePathBaseso we were surprised when calls like this ignore the base:Instead of
https://site.com/virtualdir/mycontentit navigates tohttps://site.com/mycontentwhich 404s.It's easily fixed, but is this intentional, or is this a bug?
(Edit: Probably worth noting that
ToAbsoluteUrialso ignores the base.)