Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET 5 Self-Host

I Have a project in ASP.NET 5 using self-host.

PROJECT.JSON

"commands": {
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000",
"gen": "Microsoft.Framework.CodeGeneration",
"ef":  "EntityFramework.Commands"
},

It using the http://localhost:5000...

I want to know how can i acess the website from another PC, not using localhost. Like a IP with or without DNS.

Please, help me!

like image 599
Felipe A. Avatar asked Mar 20 '26 22:03

Felipe A.


1 Answers

I was having the same issue trying to self host and only being able to access locally. I checked with Angry IP Scanner and saw that the port wasn't even open when the app was running so obviously that would prevent remote access.

Eventually I realised the --server.urls command must basically work like bindings in IIS, so where you have --server.urls http://localhost:5000, you just need to change localhost for your computer name or ip address (or add both) e.g. --server.urls http://mypc:5000.

This worked for me so I hope it does for you!

like image 191
tagustini Avatar answered Mar 22 '26 11:03

tagustini



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!