Share via


IVsAddWebReferenceResult.Save Method

Definition

Saves reference metadata in the project and creates a new Windows Communication Foundation (WCF) service reference.

public:
 System::Object ^ Save();
public:
 Platform::Object ^ Save();
winrt::Windows::Foundation::IInspectable Save();
public object Save ();
abstract member Save : unit -> obj
Public Function Save () As Object

Returns

A IVsWCFReferenceGroup object.

Examples

The following example demonstrates how to call the Save method.

if (addWebReferenceResult != null && cancelled == 0)  
{  
    return addWebReferenceResult.Save() as IVsWCFReferenceGroup;  
}  
else  
{  
    return null;  
}  

Remarks

The Save method can be used to save reference metadata in the project and to create a new WCF service reference. The save operation may fail for the following reasons:

  • The reference namespace is already used by a service reference in the client project.

  • There is a directory or file item with the same namespace in the directory where the service reference would be persisted. This can occur even if the directory or file item is not in the project.

  • The reference name is already used in the same namespace (directory) in a Web Site project. Web Site projects support adding multiple references in one namespace.

Applies to