共用方式為


IVsWCFReferenceGroup.AddReference(IDiscoverySession, String) Method

Definition

Adds a Windows Communication Foundation (WCF) service reference to a reference group.

public:
 void AddReference(Microsoft::VisualStudio::Shell::Interop::IDiscoverySession ^ pDiscoverySession, System::String ^ pszUrl);
public:
 void AddReference(Microsoft::VisualStudio::Shell::Interop::IDiscoverySession ^ pDiscoverySession, Platform::String ^ pszUrl);
void AddReference(Microsoft::VisualStudio::Shell::Interop::IDiscoverySession const & pDiscoverySession, std::wstring const & pszUrl);
public void AddReference (Microsoft.VisualStudio.Shell.Interop.IDiscoverySession pDiscoverySession, string pszUrl);
abstract member AddReference : Microsoft.VisualStudio.Shell.Interop.IDiscoverySession * string -> unit
Public Sub AddReference (pDiscoverySession As IDiscoverySession, pszUrl As String)

Parameters

pDiscoverySession
IDiscoverySession

The IDiscoverySession to use. Can be Null.

pszUrl
String

A String that contains the URL for the service.

Remarks

When the VSHPROPID_ServiceReferenceSupported property of the client project is false or the property is not supported, the AddReference method fails.

Applies to