wcf AddressAlreadyInUseException

In case this helps anyone. I had the same problem while trying to host a wcf service in console application. What I did was open Property of wcf service library (Alt + Enter or right click->Property) then go to WCF Options tab in the Property window and untick "Start WCF Service Host when debugging another project in the same solution". THen the problem is fixed.


I have found that a WCF application (or rather http.sys) can hold onto a URL for a little time after it closes down. If you try to restart it immediately, you can get the dreaded AddressAlreadyInUseException because the previous instance of the application is somehow holding it. I found that if I wait a few minutes and try again it can work.

Tags:

.Net

Wcf

.Net 4.5