I have a similar situation like here: Dynamically add reference of WCF service
However, there is one class library, which references a WCF service - let's call it CL1. Then there are multiple projects - let's call them P1 and P2 - which reference to CL1.
How it looks like now: There are two versions of CL1, just because I don't know how to dynamically add a wcf service reference. So it looks like this:
P1 uses CL1 Version 1.
P2 uses CL1 Version 2.
However, I would rather inject the URL of the service from PL1 and PL2 into CL1. So I don't have to maintain two versions!
So it should rather look like this:
Goal
P1 and P2 inject Service-URL into CL1. CL1 adds or updates the service reference (generate reference.cs and rebuilds itself).
Any ideas of how I could achieve this? Or may there be better approaches?