Pergunta

I'm trying to add multiple web references to my web reference folder. However, everytime I add a new one, it creates a new localhost folder and puts the new web reference in there. So by the end of it all, I have localhost, localhost1, localhost2, etc... in my web reference folder.

When I add the new reference, I double check to make sure the Web reference name is 'localhost' but it seems to automatically change it for me. Is there any way around this?

Foi útil?

Solução

localhost is what Visual Studio uses as the default when you add a web reference to a web service on your local machine. I always replace localhost with the name of the referenced service, e.g. BillingService or similar.

The name entered when adding the web reference (e.g. "localhost" by default) is the name of the folder in which the generated classes are put and it is also the name of the namespace in which the classes (e.g. return types of the web service) will be.

To prevent naming conflicts between different web service references (e.g. two web services returning a User type), each reference has to be put into a uniquely named namespace.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top