我正在尝试在 Raspberry Pi 上的 .net 8 上运行 ASP.NET 应用程序的可移植版本。 我有一个 Raspberry Pi 4,带有最新的精简版 Raspberry Pi oS (Bookworm)。 我的应用程序发布设置是:
Delete existing files : false
Configuration : Release
Target Framework : net8.0
Target runtime : Portable
应用程序启动并在 Pi 上输出:
info: Microsoft.Hosting.Lifetime[14]
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/dotnet/lora_api
但是,我没有收到 localhost:5000 / (RaspiLocalAddress):5000 的响应 我错过了什么吗?
看起来它只从本地主机监听?尝试更改/Properties/launchSettings.json“applicationUrl”值:
"applicationUrl": "http://+:5000",