问题
I want to deploy a Hello World Blazor Server App created with the Blazor App Source Template 3.1.11 in VS2019 C#
The app is created in VS2019 on Windows 10
The docs show how to create the /bin/Release/{TARGET FRAMEWORK}/publish folder
I copied the files here to the domain folder in my hosting package, but do not know the next step.
web.config is for windows hosting. What do I need to do for Linux? At the moment I get a 403 error if I go to the site.
I can publish the app to a windows hosted site.
[Update] It turns out that the Linux server does not have DotNet installed.
回答1:
By default, dotnet publish
publishes the entire application for running on the current operating system. When that does not match where you intend to run the application you can specify the runtime to publish for with -r|--runtime
.
Something like this should work: dotnet publish -r linux-x64
回答2:
A 403 error would lie somewhere in the IIS/web server configuration. Look at the config file or the IIS settings.
来源:https://stackoverflow.com/questions/65557009/server-error-403-forbidden-on-blazor-server-app-published-to-linux-hosting