Open WCF services in solution

I have a solution with a WCF service that works fine. I added a small console application to the solution, which should have a service link for the service in the same solution. It discovers the service, but obviously cannot connect to it because the service is down. How in Visual Studio 2010 can I start a service in a solution and at the same time add a link to a service in the same solution?

+4
source share
5 answers

Assuming the client application is in the same solution as the WCF service project, r-click the client application and select Add Service Link.

A dialog will be displayed allowing you to select your service by clicking the button in the upper right corner, labeled "Discover."

Assuming that the binding is correctly installed and available for the WCF service (via the app.config file or similar), the IDE will automatically host this service for you. - note that app.config must be located within the WCF service project, unless the specified host is already available in another project as part of the solution.

If there are problems with the hosting of the service, a new dialog will appear, with the right column for your service endpoints that indicate "Error". By clicking on the line with the error, you will find out why there is a problem, and I hope it helps you solve it.

+6
source

Not true. WCF Service projects can host themselves in the IDE to add service references

Yes, if the project with the service is the main project of the solution, but if we want to run the client application from the same solution, we need to install the main project in the client application, and as a result, the wcf application will not start by itself, so we need a helper class that contains wcf .

+2
source

If you are trying to create a console application that launches the WCF project on its own in the same solution, use the "Add Link" link (instead of "Add Service Link"), and in the "Solution" section you will find the Service in your solution.

0
source

Right-click the project in Solution Explorer and select Upload Project

Right-click the project again (this time the node will end (unavailable)) and select "Edit xxxxx.csproj

In the first section, add the following line: {3D9AD99F-2412-4246-B90B-4EAA41C64699}; {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}

Save and close the file Restart the project by right-clicking it and select Refresh. Then you can use the "Discover services in solution" functionality

Launch the application and attach the debugger to wcfsvchost.exe

0
source

http://msdn.microsoft.com/en-us/library/system.servicemodel.servicehost.aspx

You need to host your service. Create a class that will do this in the same solution

-1
source

All Articles