Visual Studio 2010: Adding a Web Reference

In previous versions of Visual Studio, you could just right click on a project and choose “Add Web Reference” to add a reference to a asmx web service. In Visual Studio 2010, when you right click, you will see “Add Service Reference”… similar, but not the same. If you reference an asmx you will get some weird objects back in your proxy web service object, each method with Request/Response at the end. You may want this, you may not. If you want to get the legacy web reference back, here is what you need to do.

Right Click on a project, Add Service Reference, then click on Advanced, the Add Web Reference. Then you will be able to add your good old asmx reference like you used to in earlier versions of Visual Studio.

image



  • http://twitter.com/Nathan_Locke Nathan Locke

    thank you for paying me to read this

  • Anonymous

    It’s a shame you haven’t investigated further how to add the web reference the official way.
    If you note that the words above that button state that this will be deprecated and is only valid for framework 2.0.
    What if you are using frameworks above 2.0?

  • http://blog.stevienova.com Steve

    it works. The right way is to create a proxy class and use that. But sometimes you are creating a small app that you just want to get it done and don’t need the proxy stuff.

  • Pingback: Where has the Add Web Reference button gone in Visual Studio 2010 « Crm Business

  • Jim@IFC

    This posting really saved my bacon. Had a web service that had been running for years with no trouble break on me today, couldn’t figure out why I wasn’t able to access the services when I tried to add it as a Service Reference in VS 2010. Obviously I need to study the current method for doing this sort of thing but when you are in a crunch like I was today, this sort of thing is a life saver. Thank you ever so much for taking the time to post this.

  • tilde

    Very Useful, thx!

  • Benmess

    Thanks. Why make it so hidden when a simple right click as before would suffice??? Thanks a bundle though.

  • Hariharasudhan C

    Very Useful. Thanks

  • Massimilano

    Thank you very much even 2 year later this funcionality is hidden as hell!!!!!
    You know when you have to mantain an old project and you have constraint and blablabla…
    This is a real life saver!!! Thanks so much.