Click here to Skip to main content
15,789,776 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

I have a website that i have created using Visual Studio 2008. I am using WCF Service to fetch and retrieve some information from my SQL server 2008. Everything works fine when the website is running and When I hosted in IIS in My Local System,it got an error like,

no connection could be made because the target machine actively refused it visual studio

However if i try and access my page that uses the WCF Services,i recieve the error about the connection being refused.

Has anyone give me any solution?



It happen because of you have multiple project inside single solution,and you have added web service reference in other project (not in your web application project)

just copy the web service reference's configuration from other project to your web application's web.config file It should work.

the problem is happen because your IIS severe is looking for web service configuration in your web.config file of your web application
Share this answer

I tried that one also(Adding Service Reference to my aplication).It shows error like below,

There was no endpoint listening at http://localhost:3331/Service1.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Share this answer
This Is fine.But my project is also working fine.When I hosted in IIS,it shows an error.
no connection could be made because the target machine actively refused it visual studio
Sandeep Mewara 8-Jun-12 3:13am    
Check event logs, troubleshoot on what mistake you have done or not configured correctly such that you are unable to use the hosted version.
Easiest way to create and consume WCF Services in
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900