ComponentServices Class

MSBuild Extension Pack

ComponentServices Class MSBuild Extension Pack Help 4.0.12.0
Valid TaskActions are:

AddComponent (Required: Path, ApplicationName Optional: Activation, Identity, UserPassword, Framework)

AddNativeComponent (Required: Path, ApplicationName Optional: Activation, Identity, UserPassword, Framework)

CheckApplicationExists (Required: ApplicationName Output: Exists)

CreateApplication (Required: ApplicationName Optional: Activation, EnforceAccessChecks, Identity, UserPassword)

DeleteApplication (Required: ApplicationName)

RemoveComponent (Required: Path Optional: Framework)

SetConstructor (Required: ApplicationName, ComponentName, ConstructorString)

SetAccessIisIntrinsicProperties (Required: ApplicationName, ComponentName Optional: AllowIntrinsicIisProperties)

SetTransactionSupport (Required: ApplicationName, ComponentName, Transaction)

ShutDownApplication (Required: ApplicationName)

UpdateApplication (Required: ApplicationName Optional: Activation, Identity, UserPassword)

Remote Execution Support: No

Inheritance Hierarchy

SystemObject  Microsoft.Build.UtilitiesTask
    MSBuild.ExtensionPackBaseTask
      MSBuild.ExtensionPack.ComputerComponentServices

Namespace: MSBuild.ExtensionPack.Computer
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 4.0.0.0

The ComponentServices type exposes the following members.

Constructors

  NameDescription
Public methodComponentServices
Top
Properties

  NameDescription
Public propertyActivation
Sets the type of activation for the application. Defaults to "Local". Supports: Local (server application), Inproc (library application)
Public propertyAllowIntrinsicIisProperties
Sets whether or not component services allows access to Intrinsic IIS properties, used for Windows 2003 components on Windows 2008 and later. Defaults to "False". Supports: True, False (allow access to Intrinsic IIS properties)
Public propertyApplicationName
Sets the name of the COM+ Application.
Public propertyComponentName
Sets the name of the COM+ component
Public propertyConstructorString
Sets the constructor string for the specified COM+ component. If empty, then the constructor support is removed
Public propertyEnforceAccessChecks
Sets whether or not component services enforces access checks for this application. Defaults to "True". Supports: True (Enforce access checks), False
Public propertyExists
Gets whether the application exists.
Public propertyFramework
Sets the version of the .NET FrameWork. Defaults to "v2.0.50727"
Public propertyIdentity
Sets the process identity for the application. Specify a valid user account or "Interactive User" to have the application assume the identity of the current logged-on user.
Public propertyPath
Sets the path to the DLL to be added to the application
Public propertyTransaction
Sets the Transaction support for the component. Supports: Ignored, None [Default], Supported, Required, RequiresNew
Top
Examples

<Project ToolsVersion="4.0" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath>
        <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath>
    </PropertyGroup>
    <Import Project="$(TPath)"/>
    <Target Name="Default">
        <!--- Add a component -->
        <MSBuild.ExtensionPack.Computer.ComponentServices TaskAction="AddComponent" Path="C:\Projects\MSBuildExtensionPack\Solutions\Main3.5\SampleScratchpad\SampleBuildBinaries\EntServices.dll" ApplicationName="MyApplication" Identity="Interactive User"/>
        <!-- Check it exists -->
        <MSBuild.ExtensionPack.Computer.ComponentServices TaskAction="CheckApplicationExists" ApplicationName="MyApplication">
            <Output TaskParameter="Exists" PropertyName="DoI"/>
        </MSBuild.ExtensionPack.Computer.ComponentServices>
        <Message Text="Exists: $(DoI)"/>
        <!--- Remove the component -->
        <MSBuild.ExtensionPack.Computer.ComponentServices TaskAction="RemoveComponent" Path="C:\Projects\MSBuildExtensionPack\Solutions\Main3.5\SampleScratchpad\SampleBuildBinaries\EntServices.dll" ApplicationName="MyApplication"/>
        <!-- Check it exists again-->
        <MSBuild.ExtensionPack.Computer.ComponentServices TaskAction="CheckApplicationExists" ApplicationName="MyApplication">
            <Output TaskParameter="Exists" PropertyName="DoI"/>
        </MSBuild.ExtensionPack.Computer.ComponentServices>
        <Message Text="Exists: $(DoI)"/>
        <!--- Add a component -->
        <MSBuild.ExtensionPack.Computer.ComponentServices TaskAction="AddComponent" Path="C:\Projects\MSBuildExtensionPack\Solutions\Main3.5\SampleScratchpad\SampleBuildBinaries\EntServices.dll" ApplicationName="MyApplication" Identity="Interactive User"/>
        <!-- Check it exists -->
        <MSBuild.ExtensionPack.Computer.ComponentServices TaskAction="CheckApplicationExists" ApplicationName="MyApplication">
            <Output TaskParameter="Exists" PropertyName="DoI"/>
        </MSBuild.ExtensionPack.Computer.ComponentServices>
        <Message Text="Exists: $(DoI)"/>
        <!-- Various quick tasks -->
        <MSBuild.ExtensionPack.Computer.ComponentServices TaskAction="ShutDownApplication" ApplicationName="MyApplication"/>
        <MSBuild.ExtensionPack.Computer.ComponentServices TaskAction="UpdateApplication" Activation="Inproc" ApplicationName="MyApplication"/>
        <MSBuild.ExtensionPack.Computer.ComponentServices TaskAction="SetTransactionSupport" Transaction="RequiresNew" ComponentName="BankComponent.Account" ApplicationName="MyApplication"/>
        <MSBuild.ExtensionPack.Computer.ComponentServices TaskAction="SetConstructor" ComponentName="BankComponent.Account" ApplicationName="MyApplication" ConstructorString="demo"/>
        <MSBuild.ExtensionPack.Computer.ComponentServices TaskAction="SetConstructor" ComponentName="BankComponent.Account" ApplicationName="MyApplication" ConstructorString=""/>
        <MSBuild.ExtensionPack.Computer.ComponentServices TaskAction="DeleteApplication" ApplicationName="MyApplication"/>
    </Target>
</Project>
See Also

Reference