次の方法で共有


IVsAddWebReferenceResult.Save Method

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

Namespace:  Microsoft.VisualStudio.WCFReference.Interop
Assembly:  Microsoft.VisualStudio.WCFReference.Interop (in Microsoft.VisualStudio.WCFReference.Interop.dll)

Syntax

'宣言
Function Save As Object
Object Save()
Object^ Save()
abstract Save : unit -> Object 
function Save() : Object

Return Value

Type: Object
A IVsWCFReferenceGroup object.

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.

Examples

The following example demonstrates how to call the Save method.

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

.NET Framework Security

See Also

Reference

IVsAddWebReferenceResult Interface

Microsoft.VisualStudio.WCFReference.Interop Namespace