O
O
Oxoron2015-10-17 21:06:13
.NET
Oxoron, 2015-10-17 21:06:13

How to host WCF on the console so that the service is available on the local network?

Good afternoon.
I created the wcf service, hosted it on the console, launched the console.
I made a client, launched it - everything is OK, the service is working properly.
Copied exe-shnik and .config of the client on the machine in a local area network. I start it - after 30 seconds I get an exception: it was not possible to reach the endpoint at 192.168.xxx.xxx.
I also cannot reach the service through a browser from a remote computer (from the local one - only on the way).
Question: how to host a wcf service through a console (WinForms) application so that there is access to the local network (excluding IIS)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2015-10-17
@Nipheris

console (WinForms)

It should be through a slash.
99% that the problem is that your service is listening on localhost and not on the real interface or on 0.0.0.0. Depending on how you host it, somewhere (in the code or config) you must have an address for listening. If it is 127.0.0.1 or localhost - you need to replace it with the address of the network interface where the service is running. Or listen on all interfaces at once, then the url will look like http://+:порт/- and if you have http, then you will need administrator rights to start (because the service will be registered in the http.sys system handler).
By and large, the question is not about WCF, but about starting a network service in principle. Apache or IIS will also not answer you over the network if you ask them to listen on localhost.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question