millimoose
millimoose

Reputation: 39990

Automatically recompile service project when updating service reference

We have a solution (called, say, Cabbage) that's split up into a WCF-based backend (Cabbage.Backend), and a frontend (Cabbage.Frontend). A problem that crops up somewhat often is that a developer changes the definition of a WCF service in Cabbage.Backend, then updates the service reference in Cabbage.Frontend without first rebuilding Cabbage.Backend. (The services are meant to be tightly coupled this way, the layers are only separated by WCF to let us deploy backend hotfixes quicker.) This regenerates the service client based on a random old build instead of the current state of the source code, the BE dev calls it a day, hilarious merge conflicts occur when the FE dev updates the client himself.

Is there any way to make Visual Studio automatically rebuild the service project / the whole solution before every run of Update Service Reference to avoid this?

Upvotes: 0

Views: 8246

Answers (1)

Keith
Keith

Reputation: 21264

If you can suffer a longer build time then consider adding a project dependency on the backend to the frontend project. When you build the frontend, the backend and all of its dependencies will also build.

Upvotes: 1

Related Questions