Skip to content

Blazor Relative URLs #15112

Closed
Closed

Description

Images in the wwwroot folder not loading when using a BasePath.

To Reproduce

  1. Using the initial release of ASP.NET Core 3
  2. Host your site on IIS in an application under the main site. In my scenario: http://valseg38/release_model_sample/
  3. On deployment the base URI is set to /release_model_sample/ in _Host.cshtml
  4. On the MainLayout.razor or Index.razor page insert an img tag pointing to an image in the wwwroot folder. In my specific scenario: <img src="/img/logo-white-icon.png">

Expected behavior

The image should load because the base url is set and the image is pointed relative to the wwwroot folder

Screenshots

image

image

image

Additional context

Docs still seem to mention index.html, which from my research is pre-core 3 release. @SteveSandersonMS seems to re-enforce the expected behavior here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions