Condividi tramite


Where The Heck is "Add Web Reference" in Visual Studio 2008?!?!

I was working on a demo for a customer and needed to use ASMX web services.  I crufted up my sample application, right-clicked the project node in the Solution Explorer pane, and saw that there is no "Add Web Reference" menu item there anymore.  Strange.  Then I went to the Project menu item and was going to select it from there, but it was grayed out.  Wha?!?  OK, I know I can use wsdl.exe to generate ASMX assets, but that doesn't answer why it was grayed out and I can't use ASMX anymore.

Turns out that you can still easily generate ASMX web references using Visual Studio 2008.  Right-click the project node in the Solution Explorer pane (or click the Project menu item) and choose "Add Service Reference..."  You will get the Add Service Reference dialog.  Click the Advanced button at the bottom left.

The next screen that appears is the Service Reference Settings dialog.  This is where you can easily enable your WCF client for asynchronous method invocation.  You can control message contract generation, and type reuse settings as well.  There's also a button at the bottom left that says "Add Web Reference".

Click that button, and you get the familiar dialog that lets you generate ASMX proxies.

Comments

  • Anonymous
    March 18, 2008
    What's wrong with using WCF to connect to ASMX? You'd get more control...

  • Anonymous
    March 19, 2008
    There's nothing wrong with it, I'd absolutely advocate using WCF over ASMX for all new development.  However, many customers are maintaining code bases with ASMX and haven't yet ported that functionality to WCF.  Visual Studio 2008 shouldn't be a blocker for them to continue development, I wrote the post to help those customers out.

  • Anonymous
    March 20, 2008
    why Microsoft change simple things when create new versions of products??? In this way can I have new features from framework 3.5 or I only have featuures from framework 2.0 as is noted in wizard ??

  • Anonymous
    April 12, 2008
    Thanks, that was very helpful.  I was wondering where the heck that stupid add web reference went.

  • Anonymous
    April 15, 2008
    Thanks for that! I've been searching for that solution all day!

  • Anonymous
    October 08, 2014
    THanks a lot you saved a lot of time.

  • Anonymous
    January 12, 2015
    Thankyou. this post helped me a lot.