I'm trying to set up a Github Pages site for my Blazor project. Even with a brand new blazor project I have had no success. I consistently hit 404 errors with an unmodified new project, following the instructions people have given on this question.
You can find my current attempt at https://billybillyjim.github.io and the repro is at https://github.com/billybillyjim/billybillyjim.github.io
My current process has been this:
Create a brand new Client-side Blazor page in Visual Studio 2019 Preview (3.0.100-preview6-012264).
Go to Github Pages and create a repo named billybillyjim.github.io
Clone the repo to a local folder using the Desktop Github app.
Using the Publish option in the Build menu of VS2019 I select a folder profile.
After a successful build I move the files created from the published folder to the repo folder.
I commit and push to github.
I add a .nojekyll file, and add the SPA javascript scripts to both a new 404.html and to the index.html.
Trying to load the page gives me a 404. "Failed to load resource: the server responded with a status of 404 ()" This error is for every dll file.
Things I have tried:
Putting everything in a folder, changing the base href in index.html, and setting the SPA script segmentCount to 1.
Removing underscores and updating the file references in index and the two blazor.js files.
Changing the href in index.html to to the repo name as described at the end of the instructions here.
I've compared my setup to the example page at https://github.com/blazor-demo/blazor-demo.github.io has a very similar setup to mine, but it's a year old and seems to use a very different set of dlls and a different blazor.js.
I am entirely new to web development, so I think it's very likely I am completely misunderstanding something simple.
I finally figured it out! I don't know how I didn't notice before, but my repo was not actually accepting my bin folder, which contains all the application's dlls. So it seems (Maybe by default?) Github pages ignores bin folders. First I tried to edit my repo's gitignore file, but it didn't seem to update to show files, so I had to manually add the files using git add -f framework/bin/ and then commit and push. Now the site is working!