title: Dotnet Run In VSCode Socket Exception
body: <p>I'm Using <strong>dotnet run</strong> to start a ASP.Net core WebApi Project in my solution in <strong>VS Code</strong>
  after executing the command , I received below exception:</p>
  <pre><code>Unhandled exception. System.Net.Sockets.SocketException (10049): The requested address is not valid in its context.
     at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
     at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
     at System.Net.Sockets.Socket.Bind(EndPoint localEP)
     at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransportOptions.CreateDefaultBoundListenSocket(EndPoint endpoint)
     at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionListener.Bind()
     at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransportFactory.BindAsync(EndPoint endpoint, CancellationToken cancellationToken)
     at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.TransportManager.BindAsync(EndPoint endPoint, ConnectionDelegate connectionDelegate, EndpointConfig endpointConfig, CancellationToken cancellationToken)
     at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.&lt;&gt;c__DisplayClass30_0`1.&lt;&lt;StartAsync&gt;g__OnBind|0&gt;d.MoveNext()
  --- End of stack trace from previous location ---
     at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context, CancellationToken cancellationToken)
     at Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions.BindAsync(AddressBindContext context, CancellationToken cancellationToken)
     at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context, CancellationToken cancellationToken)   
     at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IEnumerable`1 listenOptions, AddressBindContext context, CancellationToken cancellationToken)
     at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken)
     at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
     at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
     at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
     at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
     at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
     at NGDIR.WebApi.Program.Main(String[] args) in C:\Users\FarshadFahimi\Documents\Projects\NGDIR_MSD_BACK\src\WebApi\Program.cs:line 36
     at NGDIR.WebApi.Program.&lt;Main&gt;(String[] args)
  </code></pre>
  <p>How can I fix this ???</p>