Reputation: 1254
I'm using a WCF service and i'm hosting it in a console application. I have all of my configuration in an XML file. The service works well and i can connect it it fine from the client, but what bothers me is that when i start it the WcfSvcHost app starts (in my icon tray) and says "Your service(s) have been hosted....". But when i click on it it shows my service and under status it says Stopped (with the error that there are no endpoints defined).
I have two projects, one with the service and another one that hosts it. The error points to the project that has the service in it, which has no configuration defined since ( i assume ) it is not needed there. I have all of my configuration in the project that hosts the service, inside App.config.
How do i get rid of the message? And is it even a problem or is it normal?
P.S. I only start the project that hosts the service, not the one that has the service code.
Upvotes: 1
Views: 1498
Reputation: 1254
After some clicking around the project i've found the solution. If you right click on the Service Library project, under WCF Options, there is an option "Start WCF Service Host when debugging another project in the solution" just uncheck that and it will stop.
Also, check Scott Chamberlain's answer, that might be the cause in some cases.
Upvotes: 3
Reputation: 127603
If WcfSvcHost
is starting then your hosting app is not starting. Even though you say you are starting the hosting app double check if you have the service library is set as a start-up project.
In the above image, Startup Project should be HostingApp
you likely have it set to WcfServiceLibrary
One other possibility is your Hosting app is set up wrong, in the project settings for the hosting app, check that the output type is Windows Application
.
If you had it set to Class Library
then in your "Command line arguments" you have /client:"WcfTestClient.exe"
that would also cause your issue. This can easily happen if you started the project as a "Serivice Library" but then later decided to turn it in to the hosting app.
Upvotes: 1