Issue
When trying to start K2 Service, the following error is thrown:
Error 0 System.Exception: Error (0) . ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8866
at System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at RestSharp.Http.GetRawResponseAsync(IAsyncResult result, Action`1 callback)
at RestSharp.Http.ResponseCallback(IAsyncResult result, Action`1 callback)
--- End of inner exception stack trace ---
at SourceCode.Configuration.Client.Extensions.RestClientExtensions.<ExecuteAndEnsure>d__1`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SourceCode.Configuration.Client.Helpers.AsyncHelper.RunAsSync[T](Func`1 func)
at SourceCode.Hosting.Server.Runtime.HostLoadBalancedServerManager.Poll()
Error Code
Resolution
The error can be caused by incorrect Proxy setting in Internet Explorer > Internet Options > LAN settings > Proxy server > Advanced
Removing the above 2 entries from Proxy Settings will resolve the issue.