WSSF - cannot add service reference

May 23, 2007 at 12:50 PM
Hello, I've got problem with adding service reference to a project (VS 2005). I create new Web Servicve Software Factory solution. When i right click on any project, action "Add Service Reference" is not available from menu. When I try through Tools-->Guidance Package Manager, select "Add Service Reference" recipe for WCF and hit "execute" - it is possible to add service reference only to client project. It is also possible to add service reference from context menu by selecting Service Factory (WCF) --> Add Service Reference, but also only for client project.

How can I add service references for projects other than client?

I already reinstalled service factory, Guidance Autom. Toolkit & Extensions but it didnt seem to help.
May 23, 2007 at 2:51 PM
You can only add service references to projects that are marked with the "Client" responsability. So if you want to add a reference to a library project (tipically you will do this on a Winform or console application) you need to set the "Client" responsability to that project.
To do that, right click the solution node "Service Factory (WCF)" option and select "Unlock Solution".
Then right click your project "Service Factory (WCF)" option and select "Specify project responsability" option.
Check the "Client project" option and "Finish".
After that you should see all the Client recipes enabled for that project and you will be able to add a service reference. Notice that an App.config file will be added with all the client configuration along with the proxy class unde the "Service References" folder and the required asm references as well.

May 25, 2007 at 9:46 AM
Thanks, that helped. However I'm still a little confused because according to Guidance Package manager recipe "add service reference" applies to ANY PROJECT (for WCF), only for asmx it applies to client projects... And my colleague, sitting next to me, can add service reference without marking project as client. We both use the same version of WSSF :)
May 25, 2007 at 4:06 PM
That's a bit stange since that recipe will always run for projects marked with Client responsability (regardeless if the package is for ASMX or WCF). Make sure that the other projects that are libraries have the "Client" responsability set.
May 30, 2007 at 1:07 PM
One more question: how do i update service reference (i.e. generate the proxy class again)? There should be this action available from the menu, but i dont have it!

This screenshot is from my colleague's Visual Studio, I cannot see update action in mine...

May 30, 2007 at 3:54 PM
You don't have an update action.
Just run again the "Add service..." recipe and that will re generate the proxy class and overwrite the old one.
These proxy classes are usaully partial classes son you may have your own custom logic in a separate file and therefore your changes will not be overwritten.