I wrote a webservice by aspx in vs2008 and a windows applocation by c# in vs2008. Yhe winapp uses the webservice. I put my webservice website in wwwroot and now I can access it through local net. I create exe file from my win app.My problem is: when I want to run my winapp on another computer in that local net, one exception occurred: no connection could be made because the target machine actively refused it.127.0.0.1:1234.
Please help me to figure out it.
Also I've changed my IIS server开发者_开发技巧 port to 1234.And this port state is listening.And my webbsite is on the 10.10.10.1 IP Addr.
127.0.0.1 is the loopback address. This address allows a local machine to talk to itself. It is only useful if both your client and service are on the same machine. If you run your client on a different machine, then you need to be sure that it is using the "real" address of the machine hosting the service.
You probably have 127.0.0.1 hardcoded in a service definition in your app.config file. Find this and change it to use the correct address.
If that is your error message.
no connection could be made because the target machine actively refused it.127.0.0.1:1234
and you are
run my winapp on another computer in that local net
Then you are pointing your 'winapp' at the local computer when you should be pointing it at 10.10.10.1
精彩评论