【发布时间】:2022-01-13 10:50:59
【问题描述】:
我正在尝试运行我的 ASP.NET 网站(在 Visual Studio c# 中创建)
我按照以下步骤操作:
- 我安装了 Raspbian OS 作为树莓派的操作系统
- 我启用了 SSH 连接
- 我发布了我的网站,以便能够在 Linux 设备上运行
- 然后我将发布文件夹复制到我的 Raspberry 上(使用 WinSCP)
- 我尝试使用 Powershell 运行网站,但收到以下消息:
pi@raspberrypi:~ $ /home/pi/web/Modellfabrik
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[62]
User profile is available. Using '/home/pi/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: /home/pi
- 当我尝试在浏览器上运行网站时,使用:
http://myraspberryipadress:5000但它不起作用
【问题讨论】:
-
您使用什么托管网站?红隼?
-
如果没有更多信息,很难准确判断问题出在哪里,但可以肯定的是,应用程序现在只监听来自本地主机的连接:
http://localhost:5000。重新配置应用程序以侦听 0.0.0.0。 -
你只是在 localhost 上收听。不在任何公共界面上。更新你的 launchsettings.json
标签: c# asp.net linux visual-studio raspberry-pi