tags:

views:

28

answers:

3

My WCF service library, the console host for the service, and the client are all in separate Visual Studio solutions. Does this choice of organization impose a problem? I cannot seem to create the client proxy by using the Add Service Reference and Discovery features.

When I run the console hosted WCF service, then change focus to the Visual Studio solution for developing a client, invoke "add service reference" and "discover" it says "no services found in the solution". Do I have to develop the client code inside the same Visual Studio solution as I have developed the host code? That would seem unreasonable.

+2  A: 

Having several projects for your WCF solution is a great idea - definitely stick with that!

But you cannot run the WCF host application from within Visual Studio and then use Visual Studio to add the service reference, too, at the same time....

So what you need to do is run the service host application from outside Visual Studio (find the directory, double-click on the EXE to spin up the host) and then you can add the client service reference inside Visual Studio.

marc_s
Yes. And if you use Windows Vista or Windows 7 and HTTP based transport don't forget to use run as admin or netsh to add URL ACL.
Ladislav Mrnka
+1  A: 

Solutions are meant to have multiple projects in them. They are meant to be the level of organization that contains all of the projects you are working on at a time.

No, it's not unreasonable to put all of those related projects into a single solution.

John Saunders
+1  A: 

In such cases I usually use a single solution file containing all projects across all subsystems + separate solution files for individual subsystems. This allows me to develop the system as a whole, and, at the same time, build individual subsystems separately. This way you can overcome any “editing-time experience” shortcomings, while preserving good separation and independence of subsystems.

Ondrej Tucny
I like your opinion. However, for me to say that a certain service and a certain client will best be considered a set, in the most abstract meaning of the word, is hard to say at the beginning and likely not to be true in the future.
broiyan
I understand that and agree having a catch-all solution is rather suboptimal. However, the only other option is not to use the built-in tools in VS and resort to the command-line WCF stub generator.
Ondrej Tucny