Blazor server demo app doesn't load css on MacOS

Andrew Broughton 96 Reputation points
2021-08-31T03:13:58.883+00:00

Created a Blazor Server app from the supplied templates in both VS2022 (Windows) and VS2019 (MacOS).
Both work properly in the IDE, and when published for Windows, it works fine there.
However, when published for MacOS, neither build loads the css.
In the debug window of both Safari and Firefox on MacOS, it shows 404 for all CSS files. They are definitely appearing in the folder under wwwroot, and the main html loads properly, just not the CSS.
Can't find any discussion of this issue, and have no idea what is causing this.

Any suggestions?

Developer technologies | .NET | Blazor
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Andrew Broughton 96 Reputation points
    2021-09-09T19:34:25.79+00:00

    Works if I move the contents of the publish folder to my home folder on my Mac.

    Any idea how to tell Blazor server to look at the current folder instead of my home folder for the css and favicon files?

    0 comments No comments

  2. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2021-09-10T15:13:34.927+00:00

    most likely the paths are incorrect. on macOS (like unix) ~/path, is handled by the o/s and ~/ means users home folder.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.