0

i have a basic vagrant box with .NET Core installed in it.

In my vagrantfile I have following port forwarding:

config.vm.network "forwarded_port", guest: 5000, host: 7777

When I ssh into my machine and start using "dotnet run", application starts at localhost:5000.

When I try to access localhost:7777 on my host-machine(mac), I get "server not found".

I already tried to use an other port, but same result.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Creative crypter
  • 1,348
  • 6
  • 30
  • 67
  • can you elaborate on your application .. can you try 127.0.0.1 instead of localhost to reach the VM. depending on your application you need to make sure to bind to 0.0.0.0 so that all interfaces can access it (most likely this is your issue) – Frederic Henri Dec 05 '16 at 10:21
  • i tried 127.0.0.1 also, but same result. Could you explain how to bind to 0.0.0.0 ? thanks and greetings! – Creative crypter Dec 05 '16 at 11:17
  • 1
    thats why I asked if you can elaborate on your application and how you start it, do you reference the IP or the host name or something when you start ? – Frederic Henri Dec 05 '16 at 13:16
  • @Creativecrypter have you manage to solve the issue? i'm facing the same exact issue – nicker Mar 02 '19 at 16:47

1 Answers1

0

This post helped me, and I was experiencing the same thing. How do I disable HTTPS in ASP.NET Core 2.1 + Kestrel?

What worked for me was commenting out the following in Startup.cs:

app.UseHttpsRedirection()

And calling dotnet run with:

dotnet run --urls=http://0.0.0.0:5000
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77