This site can't be reached error

I have an asp.net MVC project developed in VS2015. Now I try to run it in VS2017 and get an error:

This site can't be reached.

What can I do with this trouble?

Upvotes: 18

Views: 43888

Answers (10)

Refat Eid
Refat Eid

Reputation: 31

matendie answer working for me,

  1. open cmd as admin
  2. cd C:\Program Files (x86)\IIS Express
  3. IisExpressAdminCmd.exe setupsslUrl -url:https://localhost:portnumber/ -UseSelfSigned

Upvotes: 2

lightcoder
lightcoder

Reputation: 53

Follow the below steps

  1. Right-click on the project and go to properties
  2. Under the Debug tab uncheck Enable SSL

enter image description here

Upvotes: 0

matendie
matendie

Reputation: 763

In my case IIS Express is not allowing https so I needed to do this:

  1. open cmd as admin
  2. cd C:\Program Files (x86)\IIS Express
  3. IisExpressAdminCmd.exe setupsslUrl -url:https://localhost:portnumber/ -UseSelfSigned

Upvotes: 27

joekevinrayan96
joekevinrayan96

Reputation: 634

Here's what I did. Right-click on the project and go to properties. Under the Debug tab uncheck and check Enable SSL. It will create a random url with port. Copy and paste the generated URL in the App URL. It worked for me fine there after.

enter image description here

Upvotes: 0

Hadi Bazmi
Hadi Bazmi

Reputation: 151

I had the same problem, I noticed that in certificate manager => personal, the localhost certificate is missing I copied that from certificate manager => TrustedRoot and the problem solved

altho it might be caused by other problems

Upvotes: 1

Sahil
Sahil

Reputation: 1

Try this...

  1. open command prompt Run as Administrator

  2. type ipconfig /flushdns -- Message should appear: "Successfully flushed the DNS Resolver Chache".

  3. after that type netsh winsock reset -- Message should be appear: "Successfully reset the winsock catalog. you must restart the computer in order to complete the reset."

  4. Then restart your machine.

Upvotes: 0

Anoj
Anoj

Reputation: 945

For the VS 2019, If you set SSL enabled for your project, there are two URLs create for your project (URL and SSL URL).

To fix this issue Go to project properties => Web: update the Project Url, Create virtual Directory and save.

Upvotes: 1

Asheq Reza
Asheq Reza

Reputation: 87

In my case, it was not the application but what I was submitting. My form contained a file I was uploading and when I hit submit I would get that error. Turns out the file couldn't be uploaded because the file was in use. I just closed the file I was trying to attach and it worked.

Upvotes: 2

Jamaurice Holt
Jamaurice Holt

Reputation: 106

Here is what I did: I went to the project tab -> properties -> Web then clicked the create virtual directory and everything started working back normal.

Upvotes: 9

Hamed Javaheri
Hamed Javaheri

Reputation: 548

Try this and it should work:

1-Go to your project folder and open .vs folder (keep your check hidden item-box checked as this folder may be hidden sometimes)

2- in .vs folder - open config

3- see that applicationhost config file there? Delete that thing.(Do not worry it will regenerate automatically once you recompile the project.)

link: localhost refused to connect Error in visual studio

Upvotes: 4

Related Questions