0

I am unable to add more than one service reference to same class.

using testApp.ServiceReference1;
using testApp.ServiceReference2;

but ServiceReference2 cannot be used as namespace here

Is it possible or not??

lovin
  • 563
  • 2
  • 14
  • 27
  • What kind of error messages are you getting? Compile time? Runtime? Where are those services defined? Are they yours or someone else's? How did you add the references to your project? Please post more details. – Mike Parkhill May 29 '12 at 11:55
  • It should definitely be possible - but you're not giving us enough information to go on, to help, really.... (1) **how** are you adding those service references? (2) What's your environment (IDE, .NET version etc.)? (3) what happens - error? If so: **what** error exactly? (4) are you trying to add the same service twice, or two different services? (5) what do those services look like (service contracts)? – marc_s May 29 '12 at 12:05
  • @mike parkhill --i am adding those services by going to project-->add service reference; --using .net framework 4; --i can addd it using above method but unable to use it in my cs file as i cannot declare the namespace for second reference, eg: using testApp.ServiceReference1-> this works fine; using testApp.ServiceReference2->this does not as it cant find this reference but it shows added in solution explorer; --both are different not same; --my service contratcs [ServiceContract] public interface IwcfTest { [OperationContract] string test(string a,int b); } – lovin May 29 '12 at 12:20

1 Answers1

0

Open the reference.cs file under the ServiceReference2 folder (Show All Files in visual studio). The namespace for the generated types will be in that file.

tom redfern
  • 30,562
  • 14
  • 91
  • 126
  • Type the name of a class from the generated file into your code. Then click on the name and do ctrl+shift+F10 to resolve the name. – tom redfern May 29 '12 at 13:23