[Solved] - No connection could be made because the target machine actively refused it 127.0.0.1:8888 

The Solution is right here 


Have you ever thought of having simple solution step by step?

Yes- this happened to me as well

However, I could only get bit and pieces of solutions after spending long hours in google search.

Today, in this blog let's see how to fix this error.

When exactly this error happens? 

Any chance when you create a website or desktop application trying to reach remote web server or web API, your local computer prompts "No connection could be made because the target machine actively refused it 127.0.0.1:8888".

Local host always referred as 127.0.0.1 

It is good to read the error message once again, to catch specific keyword to trace out error. The error message pointing to localhost(127.0.0.1:8888) followed by "Port Number" which is 88888.

The important point to notice here is the port number. Something to do with port number to get rid of this.

So, what to do now?


What might be the root cause for this error? 

The most relevant term says this,

From your error message, the port number is not allowed in the server connection you attempt.

That means, when you try to make a connection to a remote server from your local computer along port number your request is considered invalid due to few settings are not configured correctly in your application or your authentication to the resources considered invalid.

What you should do?

This article explains two solutions right here - which is already working.

Let's see one by one!

Follow the simple and easy steps in first solution to clear local memory cache. 
 

First Solution  

 
Step 1:  Close the opened application
Step 2:  Go to Run command (Windows + R
Step 3:  Type %temp% 
Step 4:  Press enter
Step 5:  Select all the files and delete (To clear local memory cache)
Step 6:  Re-start the machine if possible
Step 7:  Re-run the application as Administrator again.
  

Sometimes uncleared local computer memory cache would cause error or slowing down application performance. 

Now, let's see the second solution how to handle in Internet Information Services (IIS) 


Second Solution 

What is that to make it work?

We are forcing Internet Information Services (IIS) worker process is windows process which is (w3wp.exe) to hit remote service by forcing NOT to read cached proxy through configuration file settings.

 

What is w3wp.exe?

An Internet Information Services worker process is a windows process (w3wp.exe) which runs web applications, and is responsible for handling requests sent to web server for a specific application pool.

 

Let's get to the point,

If your application development either web or desktop the backbone is configuration file. If web application look for the web.config file where as desktop application look for App.config file in your project. 

Let's begin step by step;

Open your project solution  

 
Step 1:   If web application open your project web.config file
 Step 2:  If desktop application open your project App.config file 
 Step 3:  Copy the below code as it is. 

 <system.net>  
  <defaultProxy>   
    <proxy usesystemdefault="False"/>   
  </defaultProxy>  
</system.net>  

 Step 4 : Paste it configuration section as shown in below image 
 Step 5:  That's it. Now try to run your application 




There is similar solution here solved when computer memory affects by your program performance. This is how I solved.  

 

Summary


Thank you for reading,

I hope this article explains two simple solutions step by step guide to solve "No connection could be made" error to working solution?

The First solution is general to clear your local computer memory cache. Uncleared cache would gradually reduce the performance level.

The Second solution helps to amend a piece of code in configuration file using proxy level support.