No connection could be made because the target machine actively refused it?

后端 未结 28 2043
北荒
北荒 2020-11-22 01:27

Sometimes I get the following error while I was doing HttpWebRequest to a WebService. I copied my code below too.


System.Net.WebException: Unable to connect         


        
相关标签:
28条回答
  • 2020-11-22 01:42

    Go to your WCF project - properties -> -> debuggers -> unmark the checkbox

    Enable Edit and Continue

    0 讨论(0)
  • 2020-11-22 01:43

    The most probable reason is a Firewall.

    This article contains a set of reasons, which may be useful to you.

    From the article, possible reasons could be:

    • FTP server settings
    • Software/Personal Firewall Settings
    • Multiple Software/Personal Firewalls
    • Anti-virus Software
    • LSP Layer
    • Router Firmware
    • Computer Turned Off
    • Computer Not Plugged In
    • Fiddler
    0 讨论(0)
  • 2020-11-22 01:43

    I got this error in an application that uses AppFabric. The clue was getting a DataCacheException in the stack trace. To see if this is the issue for you, run the following PowerShell command:

    @("AppFabricCachingService","RemoteRegistry") | % { get-service $_ }
    

    If either of these two services are stopped, then you will get this error.

    0 讨论(0)
  • 2020-11-22 01:44

    it might be because of authorisation issues; that was the case for me. If you have for example: [Authorize("WriteAccess")] or [Authorize("ReadAccess")] at the top of your controller functions, try to comment them out.

    0 讨论(0)
  • 2020-11-22 01:48

    Well, I've received this error today on Windows 8 64-bit out of the blue, for the first time, and it turns out my my.ini had been reset, and the bin/mysqld file had been deleted, among other items in the "Program Files/MySQL/MySQL Server 5.6" folder.

    To fix it, I had to run the MySQL installer again, installing only the server, and copy a recent version of the my.ini file from "ProgramData/MySQL/MySQL Server 5.6", named my_2014-03-28T15-51-20.ini in my case (don't know how or why that got copied there so recently) back into "Program Files/MySQL/MySQL Server 5.6".

    The only change to the system since MySQL worked was the installation of Native Instruments' Traktor 2 and a Traktor Audio 2 sound card, which really shouldn't have caused this problem, and no one else has used the system besides me. If anyone has a clue, it would be kind of you to comment to prevent this for me and anyone else who has encountered this.

    0 讨论(0)
  • 2020-11-22 01:49

    This is really specific, but if you receive this error after trying to connect to a database using mongo, what worked for me was running mongod.exe before running mongo.exe and then the connection worked fine. Hope this helps someone.

    0 讨论(0)
提交回复
热议问题