How to Add web service reference into class library project .NET 4.0

dsi picture dsi · Jan 13, 2014 · Viewed 12.8k times · Source

I want to add web service refernece into .NET class library project 4.0.

(previously web service was used into ASP.NET web application 2.0 as "add web service refernece").

I can't find "Add web reference" but there is an option to add "Add service reference".

Please suggest, both can be same or "Add service reference" is only for WCF service.

How can i add my web service reference into this class library ?

Thank You

Answer

Thorsten Dittmar picture Thorsten Dittmar · Jan 13, 2014

Use that menu item - at the bottom of the dialog coming up there's another button for further options (German VS2010 translates to "Extended", English VS2010 says "Advanced"). In the dialog that comes up now, you can use the button "Add web service reference" in the "Compatibility" section.

Please note that configuration entries may be made to the app.config file of your DLL. As DLLs don't read the app.config file, you'll have to copy the settings to the app.config file of your application as described on SO multiple times.