This works locally, since there is no path in the URL hosting the application (i.e. https://localhost:port).
However, when this application is deployed, there might be a path between the root URL and the application.
The above code will ignore this, and the image icon-512.png will not be loaded:
Request URL:
https://azviewer-dev.tmd.belgrid.net/assets/img/icon-512.png
Request Method:
GET
Status Code:
404
The guidance should generate a relative URL (i.e. the first '/' should be deleted):
When generating a Blazor application, the file
MainLayout.razor
contains this:This works locally, since there is no path in the URL hosting the application (i.e.
https://localhost:port
).However, when this application is deployed, there might be a path between the root URL and the application. The above code will ignore this, and the image
icon-512.png
will not be loaded:The guidance should generate a relative URL (i.e. the first '/' should be deleted):