How to add a Web reference Visual Studio 2012

2019-01-17 05:54发布

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条回答
可以哭但决不认输i
2楼-- · 2019-01-17 06:35

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!

查看更多
ゆ 、 Hurt°
3楼-- · 2019-01-17 06:39

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]
查看更多
迷人小祖宗
4楼-- · 2019-01-17 06:40

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

查看更多
贪生不怕死
5楼-- · 2019-01-17 06:55

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.

查看更多
登录 后发表回答