Sunday, July 25, 2010

VS2010: Visual Studio 2010 - finding web reference option when working with Windows Forms Applications

Something I ran into today made me do a double take. This could have originated from the initial configuration choice I made when setting up Visual Studio 2010 or the tool is trying to be so smart it starts to get confusing..


However it happened, it does seem to make things more difficult when trying to create windows form applications. In particular, if you want to use a web-reference in your regular windows application the number of clicks has increased and discoverability has decreased.

Adding web-references to consume web services in ASP.NET application is not impacted by this change. In particular the context sensitive links to add web-reference are gone when I am in the Solution Explorer working on a Windows Form Application.






Instead the only thing you can seemingly do is to add a service reference. Though you can start here, web services that are registered through this channel do not behave at all like the previous releases of Visual Studio. Thus, beware, this is not what you want to do if you want to consume a regular web service, especially ones that are not created with VS to begin with. To get to the plain Jane adding of a web service you have to walk through some additional steps.

A) Select the "Add Service Reference..." option, then, click on the "Advanced..." button.





B) Click on the "Add Web Service" button from the advanced screen:




Allright that should do it to bring you back into the old web service ways.

Cheers,

B

12 comments:

Unknown said...

thank you I thought I was going crazy because I could not find the create web-reference on the menu!

Unknown said...

Just cool. Its simple but its very Key to the surpurising WebReference. Thanks a lot..

Unknown said...

Thanks man, you saved my time :)

bitblit said...

Thanks, this resolved an issue I was having creating a web reference to SQL Server Reporting Services.

Until I did this I could not find or reference the ReportingService2010 class. Instead all that was available was ReportingService2010SoapClient.

Nir said...

I'm using a book about Visual Stuio 2010 (published by Microsoft) showing the Web Reference dialog but the book is obviously out of date. Cheers for this!

RabidTribble said...

Thank you so much for this! I cannot tell you how much time I spent trying to get this registered correctly.... none of Microsoft's postings seem to tell you to add it specifically as a web reference.

Suneela said...

thank you so much. It was so helpful

Unknown said...
This comment has been removed by the author.
Unknown said...

This was a quick fix to a problem that was causing some serious issues. I wasn't even aware that a web reference and a service reference were different. Thanks a lot!

Jivan said...

Thank you!! This is exactly the aid I was looking for!!

Unknown said...
This comment has been removed by the author.
ttav said...

thanks alot...