No connection could be made because the target computer the actively refused
<p>i am kinda new working with Asp.net Rest and i dont know how to solve this, i already read many articles at stackoverflow and no one solved my problem, i tryed firewall i tryed the configurations on internet option and other things, i think the problem can be related to something that is confusing me, do i need to run the webservice before i run my client application ?? how to do it? because what i did was just programming my rest application then i created my asp.net mvc application where i connect to the rest service with this helper</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using System.Net.Http;
namespace ClienteMvcProdutos.Helpers
{
    public static class WebApiHttpClient
    {
        public const string WebApiBaseAddress = "http://localhost:25426/";
        public static HttpClient GetClient()
        {
            HttpClient client = new HttpClient();
            client.BaseAddress = new Uri(WebApiBaseAddress);
            client.DefaultRequestHeaders.Accept.Clear();
            client.DefaultRequestHeaders.Accept.Add(
            new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
            return client;
        }
    }
}
</code></pre>

<p>already checked ports and they matched, already changed ports and it still dont work im kinda desesperating :S here is my stacktrace</p>

<blockquote>
  <p>[SocketException (0x274d): Nenhuma ligação pôde ser feita porque o computador de destino
  as recusou activamente 127.0.0.1:25426]
     System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) +6604828
     System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket&amp; socket, IPAddress&amp; address, ConnectSocketState state, IAsyncResult asyncResult, Exception&amp; exception) +249</p>
  
  <p>[WebException: Unable to connect to the remote server]<br>
  System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
  +606    System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
  +64</p>
  
  <p>[HttpRequestException: An error occurred while sending the request.]<br>
  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
  task) +92<br>
  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
  task) +58    System.Runtime.CompilerServices.TaskAwaiter<code>1.GetResult()
  +28    ClientMvcProdutos.Controllers.&lt;Index&gt;d__1.MoveNext() in C:\Users\Filipe\Documents\Visual Studio
  2015\Projects\ClientMvcProdutos\ClientMvcProdutos\Controllers\ProdutosController.cs:25
  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
  task) +92<br>
  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
  task) +58    System.Runtime.CompilerServices.TaskAwaiter.GetResult()
  +26    System.Threading.Tasks.TaskHelpersExtensions.ThrowIfFaulted(Task task)
  +42    System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult
  asyncResult) +73<br>
  System.Web.Mvc.Async.&lt;&gt;c__DisplayClass37.&lt;BeginInvokeAsynchronousActionMethod&gt;b__36(IAsyncResult
  asyncResult) +37<br>
  System.Web.Mvc.Async.WrappedAsyncResult</code>1.CallEndDelegate(IAsyncResult
  asyncResult) +27<br>
  System.Web.Mvc.Async.WrappedAsyncResultBase<code>1.End() +58<br>
  System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult,
  Object tag) +68<br>
  System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult
  asyncResult) +34<br>
  System.Web.Mvc.Async.AsyncInvocationWithFilters.&lt;InvokeActionMethodFilterAsynchronouslyRecursive&gt;b__3d()
  +69    System.Web.Mvc.Async.&lt;&gt;c__DisplayClass46.&lt;InvokeActionMethodFilterAsynchronouslyRecursive&gt;b__3f()
  +230    System.Web.Mvc.Async.&lt;&gt;c__DisplayClass33.&lt;BeginInvokeActionMethodWithFilters&gt;b__32(IAsyncResult asyncResult) +27<br>
  System.Web.Mvc.Async.WrappedAsyncResult</code>1.CallEndDelegate(IAsyncResult
  asyncResult) +27<br>
  System.Web.Mvc.Async.WrappedAsyncResultBase<code>1.End() +58<br>
  System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult,
  Object tag) +68<br>
  System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult
  asyncResult) +34<br>
  System.Web.Mvc.Async.&lt;&gt;c__DisplayClass2b.&lt;BeginInvokeAction&gt;b__1c()
  +42    System.Web.Mvc.Async.&lt;&gt;c__DisplayClass21.&lt;BeginInvokeAction&gt;b__1e(IAsyncResult
  asyncResult) +124<br>
  System.Web.Mvc.Async.WrappedAsyncResult</code>1.CallEndDelegate(IAsyncResult
  asyncResult) +27<br>
  System.Web.Mvc.Async.WrappedAsyncResultBase<code>1.End() +58<br>
  System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult,
  Object tag) +30<br>
  System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult
  asyncResult) +29<br>
  System.Web.Mvc.Controller.&lt;BeginExecuteCore&gt;b__1d(IAsyncResult
  asyncResult, ExecuteCoreState innerState) +27<br>
  System.Web.Mvc.Async.WrappedAsyncVoid</code>1.CallEndDelegate(IAsyncResult
  asyncResult) +48<br>
  System.Web.Mvc.Async.WrappedAsyncResultBase<code>1.End() +58<br>
  System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult,
  Object tag) +30<br>
  System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult,
  Object tag) +21<br>
  System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +32
  System.Web.Mvc.Controller.&lt;BeginExecute&gt;b__15(IAsyncResult
  asyncResult, Controller controller) +26<br>
  System.Web.Mvc.Async.WrappedAsyncVoid</code>1.CallEndDelegate(IAsyncResult
  asyncResult) +40<br>
  System.Web.Mvc.Async.WrappedAsyncResultBase<code>1.End() +58<br>
  System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult,
  Object tag) +30<br>
  System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult,
  Object tag) +21    System.Web.Mvc.Controller.EndExecute(IAsyncResult
  asyncResult) +29<br>
  System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult
  asyncResult) +24<br>
  System.Web.Mvc.MvcHandler.&lt;BeginProcessRequest&gt;b__5(IAsyncResult
  asyncResult, ProcessRequestState innerState) +27<br>
  System.Web.Mvc.Async.WrappedAsyncVoid</code>1.CallEndDelegate(IAsyncResult
  asyncResult) +48<br>
  System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +58<br>
  System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult,
  Object tag) +30<br>
  System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult,
  Object tag) +21<br>
  System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
  +29    System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult
  result) +23<br>
  System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult
  ar) +129</p>
</blockquote>