Kirsten
Kirsten

Reputation: 18160

Server Error 403 Forbidden on Blazor server app published to Linux hosting

I want to deploy a Hello World Blazor Server App created with the Blazor App Source Template 3.1.11 in VS2019 C# template

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.

files

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.

Upvotes: 0

Views: 3132

Answers (2)

Matt
Matt

Reputation: 23

A 403 error would lie somewhere in the IIS/web server configuration. Look at the config file or the IIS settings.

Upvotes: 0

Tim
Tim

Reputation: 2707

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

Upvotes: 2

Related Questions