This documentation is archived and is not being maintained.

ComContractsSection Class

Represents a configuration section that contains elements for specifying the namespace and contract name for a COM+ integration contract. This class cannot be inherited.

Namespace:  System.ServiceModel.Configuration
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public sealed class ComContractsSection : ConfigurationSection

The COM+ integration service contracts are currently restricted to the “” namespace, and contract name is derived from the supporting COM interface. You can, however, specify alternatives by using the comContracts section in the configuration file. For example, you can use the following configuration to specify the namespace and contract name for a service contract

  <!--   <configuration> -->
  <!--     <system.serviceModel> -->
  <!--       <services> -->

<!-- <comContracts> is under <system.ServiceModel> -->
<!-- it is at same level as <services> or <behaviors> -->
  <comContract contract="{C551FBA9-E3AA-4272-8C2A-84BD8D290AC7}" 
    namespace="" />
  <comContract contract="{BBA0C8B8-78DC-4C7B-919D-D2253100896B}" 
    namespace="" />

  <!--     </behaviors> -->
  <!--   </system.serviceModel> -->

When the service is initialized, the specified namespaces and contract names are applied to the generated service descriptions.

When this section is empty, the service initialization applies a default namespace and contract name taken from the supporting COM interface ID.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0