I’m trying to run my ASP.NET website (created in Visual Studio c#)
I followed this Steps:
- I installed Raspbian OS as operating system for the Raspberry pi
- I enabled SSH connection
- I published my website so that is able to run on Linux device
- Then I copied the publish folder on my Raspberry (using WinSCP)
- I tried to run the Website with Powershell, I got this message:
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
- When I tried to run the website on my browser using:
http://myraspberryipadress:5000
but it does not work
2
Answers
You probably don’t have port 5000 open on your raspberry pi.
Run
nmap -sT -p- <192.168.0.X.X>
to see the list of available ports open on your pi.Check out an article like this for how to open that specific port.
Or – even safer, setup a reverse proxy nginx server on the pi. Link
It’s been a long time, but still…
Raspberry spins only
http://localhost:5000
andhttp://myraspberryipadress:5000
will not work.You have to add to your "appsettings.json" this line
"Urls": "http://[::]:5000"
or"http://[*]:5000"