Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am in a university project group of six people, and we are using C# (with Microsoft Visual Studio 2017 as IDE) to make a program, that can manage a beer production system.
I have a weird problem that i have no idea how to fix. Whenever I through Visual Studio, try to connect to a database or a server of any kind, I get an error.

In my project group, we are using a postgreSQL databse, and whenever I try connecting to it, I get the following error:
System.Net.SocketException (0x80004005): No such host is known
at System.Net.Dns.GetAddrInfo(String name)
at System.Net.Dns.InternalGetHostByname(String hostName, Boolean includeIPv6)

No one else in my project group gets this error, and the problem persists with all applications I try to run in Visual Studio. As mentioned it is not just with databases the problem occurs. I can't even connect to a simple server being run from a friends pc.

My laptop uses Windows 10 as OS.

What I have tried:

I have tried installing Visual Studio on my other computer (a desktop, also Windows 10), and the same problem occurs.

I have tried googling for solutions for hours without result.

I have tried running the program on two different networks, so I have ruled out the network as a problem.

I have also pretty much ruled out the port as a problem. I have tried going to the advanced firewall settings, making a rule opening the port used in the program. I have tried changing the port used in the program.

I have made sure that Visual Studio has access through the firewall on both pc's.
Posted
Updated 21-Nov-18 19:36pm
Comments
F-ES Sitecore 12-Nov-18 5:01am    
Try putting the relevant host and IP in your system32\drivers\etc\hosts file.

1 solution

Hi,

The information that you provided is not enough and to complicated. You are referring to several problems. Let`s make progress step-by-step. Follow my solution and leave comments I will read and change/improve the solution according to your progress until we get it solve. Ok?
So first, please use CMD and ping localhost I expect you get replay like this:

Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128


2- Make sure you don`t have any virtual NIC, for example if you are using virtual machine try to disable other adapters.
3- No proxy should be running
4- Reset your firewall settings to default or for now just disable it
5- Make sure your anti-virus does not mass up with any socket/port/interface
6- Write a small socket based application and see if you are able to make it up and running, something very simple. First try on localhost then go for network.
7- Do not cut your hairs we still do have some other tries just leave a comment.

Btw, if you wanted to write comment please also add results of ipconfig -all if you are not families with ipconfig ask Mr.Google
Good luck
AH
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900