34

Is it possible to add a web reference to my project in Visual Studio 2012? In Visual Studio 2010 it was possible by clicking the "Advanced" button in the "Add Service Reference" dialog, as it is written on this page : Add Web Reference in Visual Studio 2010

But in Visual Studio 2012 there is no section "Compatibility" in the "Service Reference Settings" and no "Add Web Reference" button in this dialog. I want to use SOAP web-service, but it works correctly only when I add it as Web Reference (in .NET Framework 2.0 compatibility mode. If I Add it as usual service reference I have an exception during using this service).

How to add old-style web reference to my project?
Or how to use my web service with new style of service references?

Thanks

4 Answers 4

70

check the link below

MSDN Link

To add a Web reference to a project

1 In Solution Explorer, right-click the name of the project that you want to add the service to, and then click Add Service Reference.

The Add Service Reference dialog box appears.

2 In the Add Service Reference dialog box, click the Advanced button.

3 The Service Reference Settings dialog box appears.

4 In the Service Reference Settings dialog box, click Add Web Reference.

The Add Web Reference dialog box appears.

Sign up to request clarification or add additional context in comments.

4 Comments

Sorry, but I can't find "Add Web reference" button in Service Reference Settings Dialog. I use Visial Studio 2012 Ultimate on Windows 8 and write Windows Store Application (Metro-Style). May be I need to install any third-party addins? Here the screenshot of my Service Reference Settings dialog: dl.dropbox.com/u/31216763/SRSettings.png Can you show me screenshot of your dialog?
sorry for late reply but check this link c-sharpcorner.com/UploadFile/99bb20/…
You also need to make sure that your project targets .NET framework 3.5 or below. To change this, right click on your project and click properties. In the Application tab, check Target Framework.
Thanks for your clean answer. Knowing differences between Service reference and web reference may be useful ,too: stackoverflow.com/questions/2158106/…
6

Solved. CheckBox "Always generate message contracts" Helped. Thanks for all.

1 Comment

you should probably mark informative topic as an asnwer. I garantee, community will be thankful for that :)
4

From MSDN:

  1. In Solution Explorer, right-click the name of the project that you want to add the service to, and then click Add Service Reference. The Add Service Reference dialog box appears.

  2. In the Add Service Reference dialog box, click the Advanced button. The Service Reference Settings dialog box appears.

  3. In the Service Reference Settings dialog box, click Add Web Reference. The Add Web Reference dialog box appears.

Hope this helps!

4 Comments

Hmm. do you have Visual Studio 2010 available? I know it works in VS2010 so maybe if you had that (or a trial), you could add the reference there, and then reopen the project in 2012 (which would probably have to convert it back to a 2012 project). This seems kind of hacky, but I'm not sure what else to do if you don't have the option. It should be there.
Yes, I have Visual Studio 2010. But I just looked, this button is present in Visual Studio 2012, but only in Windows Forms Application project. When I try to add web reference to Windows Store Application, that also known as Modern-style (Metro-style) application I see modified Service Reference Settings dialog without Add Web Reference button (shown at screenshot). There is a way to beat it, or I'll have to manually configure SOAP requests to the server and handle the answers?
I'm really not sure. I'm familiar with Visual Studio, but not 2012 or Metro-style apps.
1

Visual Studios 2013 uses newer version of .NET Framework 4.5.1, which will not work with this web service http://wsf.cdyne.com/weatherws/weather.asmx and others. but using .NET 3.5 works!

so, if your starting a new project select from drop down menu .NET Framework 3.5 or if you are already in a project and want to change Framework

1 Click [DEBUG] > '<YOUR_PROJECT_NAME>' Properties

2 Click [Build] and change target Framework

3 Click [OK]

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.