WCF Service Host Configuration - Please try changing the HTTP port to 8732

前端 未结 4 868
轮回少年
轮回少年 2021-02-05 18:03

I had a complex WCF service based solution working on my PC but due to a problem installing Windows 8.1 I had to \'Refresh\' my PC. Now that I\'ve reinstalled Visual Studio 2012

4条回答
  •  不思量自难忘°
    2021-02-05 18:30

    After a bit of digging around and research I found out that recent versions of Windows enforce security settings that prevent you from listening to any ports. I’m assuming that when Visual Studio is installed it reserves a port for it’s own use so that you can host and thus debug web services. This was the localhost:8732 port on my development machine but with reinstalling Visual studio it is now localhost:8733, unfortunately all my app.config files in the solution point to port 8732.

    Run an elevated command prompt and execute netsh http show urlacl. This displays the list of reserved ports amongst which I found this:

    Reserved URL            : http://+:8733/Design_Time_Addresses/
    User: NT AUTHORITY\INTERACTIVE
    

    Which, I’m assuming, is the entry added when Visual Studio was installed.

    Executing the following command reserves the 8732 url/port:

    netsh http add urlacl url=http://+:8732/ user=WORK\Clara
    

    Restart Visual Studio and all of a sudden my solution works again.

提交回复
热议问题