0

My solution cotains the following projects

  • A (wcf service)
  • B (wcf service)
  • foo (references A)
  • bar (references B)

If I make a change to A, we have to update the service reference in foo.

The way we have to do this now is to manually start A & B in Visual Studio by going to Debug | Start New Instance so that Cassini starts the service (http://localhost:59445/A.svc), and then go to foo and update the service reference.

I would like to find a way (command line driven preferably) to automatically update the service references in foo and bar. There has got to be a better way of doing this then doing this manually.

Suggestions?

EDIT: I expected to get some "you are doing it wrong!" comments. The reason I need to do this is because we are occasionally adding new features to the services and thus changing the contracts. But an even bigger reason is that we are using DVCS (mercurial) and to make matters worse we are merging from a branch that is running in VS2008 into another branch running VS2010. Every such merge pretty much screws up the VS2010 service references, and its just a heck of a lot easier to update the service references. We have to do this by hand now. It would be much nicer to do it automatically.

WhiskerBiscuit
  • 4,795
  • 8
  • 62
  • 100

2 Answers2

4

If you can, you should do away with your service reference altogether. Just create a binary reference to the service contract DLL and then use ChannelFactory on the client to create a channel on the fly (example here).

Then if your service contract changes you only need to update this assembly reference.

Community
  • 1
  • 1
tom redfern
  • 30,562
  • 14
  • 91
  • 126
2

You can look at this blog post (+ part 2) or this forum post or even this SO post. It isn't out of the box available, so the provided solutions might be kind of complex and time consuming to configure for your situation, but anyway, that's up to you of course.

Community
  • 1
  • 1
Styxxy
  • 7,462
  • 3
  • 40
  • 45
  • That's funny, when I posted it, it worked. Try to get there through this url: http://blogs.microsoft.co.il/blogs/oshvartz/ – Styxxy May 04 '12 at 13:35
  • @WhiskerBiscuit : I updated the URL's, now they should work again (I added also a link to part 2 of the blog post). – Styxxy May 04 '12 at 14:44