tags:

views:

81

answers:

2

Hey.

I want to update service references in a Visual Studio 2010 solution by using SVCUtil because this solution has several projects and it's not good to get references refreshed one by one.

I'd like to know your point, because I've to be sure I'm going to execute exactly same command than one done by Visual Studio 2010, or even if Visual Studio 2010 doesn't use SVCUtil, an equivalent command to IDE's behavior.

Thank you very much.

A: 

Some googling here and here shows the settings on VS 2008, although this will depend of course on your options in the Advanced options in the Add Service Reference wizard.

Edit : Agreed - Never be afraid to drop and recreate service references from scratch. When working with version control like TFS, "update" service references there is often quite a mess as it figures which wsdl, xsd and disco files etc have been changed, added or deleted etc (and get filenames like SomeXSD92.xsd). Generally it is quicker to just drop and recreate them.

Johan's post is makes a good point (and can be used as part of a standard design pattern called Service Agent which handles the implementation of the client proxy). I'm not quite sure what you mean when you say two tiers would need to reference the same assembly? If you are sharing type of the entities called in the service you would need to reference the entity assembly in most tiers anyway. For your Service Agent assembly project (which has all the service references) you can either re-expose the same Service Contract used by the WCF server or wrap it in a new interface.

nonnb
Thank you for your answer. I'm not sure this is what I need for doing that reference update. I found before your first link, second one is a good info, but anyway, I don't want to "add service reference" but "update service reference". Maybe I'm wrong, but it's possible that updating is like dropping and re-creating all, isn't it?
Matías Fidemraizer
Sorry for my delay.
Matías Fidemraizer
Sorry for my delay. I'm currently solving that with VS Automation (EnvDTE) which is more elegant and ensures service references are updated exactly by using same VS command raised from the UI.
Matías Fidemraizer
A: 

The easiest way to refresh a lot of service references is to put all those in a dedicated project. Reference this project from all the projects that need to use them. If a service reference needs to be updated, you will do it in one place only.

Johann Blais
Right, I believe this is a good solution! Thank you! Anyway, problem is if you've a client-server infraestructure, you'd not be able to do that, because you don't want a project having dependencies to both tiers.
Matías Fidemraizer