Question

I'm using Visual Studio 2008 with a project that's targeting .NET 2.0. I need to add a reference to a WCF service that's defined in another project within the same solution. The WCF project targets .NET 3.5, and the service uses basicHttpBinding.

Because the client project is configured to target .NET 2.0, I don't have the option to "Add Service Reference". When I try to "Add Web Reference", and select "Web services in this solution", I get the following message:

No Web services were found in the current solution.

What am I doing wrong?

Was it helpful?

Solution

Web References are for the legacy ASMX techology. "Add Web Reference" naturally doesn't know that WCF even exists, so it shouldn't be surprising that it doesn't know about your WCF service in the solution. It's looking for .asmx files.

Try starting your service first by right-clicking the .svc file and using "View in Browser". Then give the URL of the service to the "Add Web Reference" dialog. Also, make sure your service exposes its metadata, so that the "?WSDL" will generate the WSDL for Add Web Reference.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top