Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ComContractsSection Class
Collapse the table of content
Expand the table of content

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 “http://tempuri.org” 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> -->
</services>

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

<behaviors>
  <!--     </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

Community Additions

ADD
Show:
© 2015 Microsoft