问题
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)
回答1:
Blazor WebAssembly:
https://docs.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly?view=aspnetcore-3.1#standalone-deployment
- scroll down to "Apache"
Blazor server:
https://docs.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/server?view=aspnetcore-3.1#linux-with-apache
来源:https://stackoverflow.com/questions/63678029/how-can-i-publish-a-blazor-client-server-app-to-a-linux-web-server-dont-have-a