Blazor服务器应用程序上的Server Error 403 Forbidden禁止发布到Linux托管 [英] Server Error 403 Forbidden on Blazor server app published to Linux hosting

查看:54
本文介绍了Blazor服务器应用程序上的Server Error 403 Forbidden禁止发布到Linux托管的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在VS2019 C#中部署使用Blazor App源模板3.1.11创建的Hello World Blazor Server应用程序

该应用程序是在Windows 10上的VS2019中创建的

web.config用于Windows托管.对于Linux,我需要做什么?目前,如果我转到该网站,则会收到403错误.

我可以将应用程序发布到Windows托管站点.

[更新]事实证明Linux服务器没有安装DotNet.

解决方案

默认情况下, dotnet publish 发布用于在当前操作系统上运行的整个应用程序.如果与您打算运行应用程序的位置不匹配,则可以使用 -r | --runtime 指定要发布的运行时.

类似的东西应该起作用: dotnet publish -r linux-x64

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.

解决方案

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

这篇关于Blazor服务器应用程序上的Server Error 403 Forbidden禁止发布到Linux托管的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆