I won't bore you with the directors' cut of the past couple of hours. I'll just give you the highlights...
Strange. So what was it about this service project that differed from the others ? In fact, they were all slightly different. That was the idea. But they were all good services.
Now each of the services implemented the same contract and so every service I was trying to add a reference to contained the same service name as the one I had added originally.
So I began to think about a possible clash. Was something left behind?
I had removed the service reference and associated code, WSDL and XSD files etc. So that left two possibilities. It was either lurking in the client project file or the solution file. I opened each with Notepad.
Second time lucky. It was in the solution file.
Within the entry for the client project, there was a dependency on something that no longer existed. i.e. the original service project.
I removed the ProjectSection entry and tried once more to add a service reference to an alternate service. It worked!
So my demo now involves me removing this section after showing off each variant of DataContract.
Having found the problem AND the solution, I could have still rewritten it to use multiple endpoints instead but figured it was useful as it stands as it reveals an obscure error that some delegates are likely to encounter when working on something similar. Perhaps some form of brokerage service where during development they need to work with a variety of similar services.
简而言之就是你要添加到的项目所依赖的其他项目被unload了。