How can I publish a blazor client/server app to a linux web server? Don't have access to ssh and dotnet publish doesn't give an index.html
Asked Answered
H

1

9

I've built a blazor app that has no issues at the moment. When I call "dotnet publish -c Release" I get a published project, except the output is an executable file that ubuntu picks up as an octet-stream or something along the lines. If I run it, it just opens the server on localhost:5000. Copying this to my web server through cpanel did nothing -- even trying to test out a generic blazor Wasm app and publishing it gave me an index.html, but it would never actually load anything when I uploaded it to my web server. How can I get dotnet to publish this with an index.html file? All I get is the js and css folders and the executable file on the outer "wwwroot" folder.

(P.S. I'm using webhostingpad.com with shared hosting, so I don't have access to ssh to do things like installing nginx or a parallel route through IIS or Azure or something)

Hipster answered 31/8, 2020 at 20:51 Comment(1)
I tired to make it work using local WAMP on a Windows 10 PC and failed. So while Microsoft claim it will work they don't provide clear instructions on how to make it work. This means it won't be adopted by the non-Azure community and so will be abandoned my Microsoft in future! My advice is to stick with Javascript.Laaspere
V
2

Blazor WebAssembly:

https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly?view=aspnetcore-3.1#standalone-deployment

  • scroll down to "Apache"

Blazor server:

https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/server?view=aspnetcore-3.1#linux-with-apache

Valenciavalenciennes answered 8/10, 2020 at 10:51 Comment(1)
As usual the Microsoft documentation is woeful. There's a Publish option in Visual Studio that creates a load of files. Where do we deploy these? Read the link above and you'll have NO IDEALaaspere

© 2022 - 2024 — McMap. All rights reserved.