Dela via


Configure Service Reference Dialog Box

The Configure Service Reference dialog box enables you to configure the behavior of Windows Communication Foundation (WCF) services.

Note

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Working with Settings.

To access the Configure Service Reference dialog box, right-click a service reference in Solution Explorer and choose Configure Service Reference. You can also access the dialog box by clicking the Advanced button in the Add Service Reference Dialog Box.

  • To change the address where a WCF service is hosted, enter the new address in the Address field.

  • To change the access level for classes in a WCF client, select an access-level keyword in the Access level for generated classes list.

  • To call the methods of a WCF service asynchronously, select the Generate asynchronous operations check box.

  • To generate message contract types in a WCF client, select the Always generate message contracts check box.

  • To specify list or dictionary collection types for a WCF client, select the types from the Collection type and Dictionary collection type lists.

  • To disable type sharing, clear the Reuse types in referenced assemblies check box. To enable type sharing for a subset of referenced assemblies, select the Reuse types in referenced assemblies check box, select Reuse types in specified referenced assemblies, and select the desired references in the Referenced assemblies list.

  • Address
    Used to update the Web address where a service reference looks for a service. For example, during development the service may be hosted on a development server then later moved to a production server, necessitating an address change.

    Note

    The Address element is not available when the Configure Service Reference dialog box is displayed from the Add Service Reference Dialog Box.

  • Access level for generated classes
    Determines the code access level for WCF client classes.

    Note

    For Website projects, this option is always set to Public and cannot be changed. For more information, see Troubleshooting Service References.

  • Generate asynchronous operations
    Determines whether WCF service methods will be called synchronously (the default) or asynchronously.

  • Always generate message contracts
    Determines whether message contract types will be generated for a WCF client. For more information about message contracts, see Using Message Contracts.

  • Collection type
    Specifies the list collection type for a WCF client. The default type is Array.

  • Dictionary collection type
    Specifies the dictionary collection type for a WCF client. The default type is Dictionary<TKey, TValue>.

  • Reuse types in referenced assemblies
    Determines whether a WCF client will try to reuse that already exist in referenced assemblies instead of generating new types when a service is added or updated. By default, this option is checked.

  • Reuse types in all referenced assemblies
    When selected, all types in the Referenced assemblies list will be reused if possible. By default, this option is selected.

  • Reuse types in specified referenced assemblies
    When selected, only the selected types in the Referenced assemblies list will be reused.

  • Referenced assemblies list
    Contains a list of referenced assemblies for the project or Web site. When Reuse types in specified referenced assemblies is selected, individual assemblies can be selected or cleared.

  • Add Web Reference
    Displays the Add Web Reference Dialog Box.

    Note

    This option should be used only for projects that target version 2.0 of the .NET Framework.

    Note

    The Add Web Reference button is available only when the Configure Service Reference dialog box is displayed from the Add Service Reference Dialog Box.

See Also

Tasks

How to: Add, Update, or Remove a Service Reference

How to: Add a Reference to a Web Service

Reference

Add Service Reference Dialog Box

Configure Service Reference Dialog Box

Other Resources

Consuming ASMX and WCF Services Sample