MSMQ Class

MSBuild Extension Pack

MSMQ Class MSBuild Extension Pack Help 4.0.12.0
Valid TaskActions are:

Create (Required: Path Optional: Label, Transactional, Authenticated, MaximumQueueSize, MaximumJournalSize, UseJournalQueue, Force, Privacy )

CheckExists (Required: Path Output: Exists )

Delete (Required: Path Optional: )

Send (Required: Path Optional: Message, Label )

SetPermissions (Required: Path Optional: Allow, Deny, Revoke, Set )

Remote Execution Support: No

Inheritance Hierarchy

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

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

The MSMQ type exposes the following members.

Constructors

  NameDescription
Public methodMSMQ
Top
Properties

  NameDescription
Public propertyAllow
An access-allowed entry that causes the new rights to be added to any existing rights the trustee has. Permission metadata supports: DeleteMessage, PeekMessage, WriteMessage, DeleteJournalMessage, SetQueueProperties, GetQueueProperties, DeleteQueue, GetQueuePermissions, ChangeQueuePermissions, TakeQueueOwnership, ReceiveMessage, ReceiveJournalMessage, GenericRead, GenericWrite, FullControl
Public propertyAuthenticated
Set to try to create an Authenticated queueu. Default is false
Public propertyDeny
An access-denied entry that denies the specified rights in addition to any currently denied rights of the trustee. Permission metadata supports: DeleteMessage, PeekMessage, WriteMessage, DeleteJournalMessage, SetQueueProperties, GetQueueProperties, DeleteQueue, GetQueuePermissions, ChangeQueuePermissions, TakeQueueOwnership, ReceiveMessage, ReceiveJournalMessage, GenericRead, GenericWrite, FullControl
Public propertyExists
Gets whether the queue exists
Public propertyForce
Set to true to recreate a queue if it already exists
Public propertyLabel
Sets the Label of the queue
Public propertyMaximumJournalSize
Sets the maximum journal size in kb.
Public propertyMaximumQueueSize
Sets the maximum queue size in kb.
Public propertyMessage
Sets the Message to send to the queue
Public propertyPath
Sets the path of the queue. Required.
Public propertyPrivacy
You can specify whether the queue accepts private (encrypted) messages, non-private (non-encrypted) messages, or both. Supports Optional (default), None, Both.
Public propertyRevoke
An entry that removes all existing allowed or denied rights for the specified trustee. Permission metadata supports: DeleteMessage, PeekMessage, WriteMessage, DeleteJournalMessage, SetQueueProperties, GetQueueProperties, DeleteQueue, GetQueuePermissions, ChangeQueuePermissions, TakeQueueOwnership, ReceiveMessage, ReceiveJournalMessage, GenericRead, GenericWrite, FullControl
Public propertySet
An access-allowed entry that is similar to Allow, except that the new entry allows only the specified rights. Using it discards any existing rights, including all existing access-denied entries for the trustee. Permission metadata supports: DeleteMessage, PeekMessage, WriteMessage, DeleteJournalMessage, SetQueueProperties, GetQueueProperties, DeleteQueue, GetQueuePermissions, ChangeQueuePermissions, TakeQueueOwnership, ReceiveMessage, ReceiveJournalMessage, GenericRead, GenericWrite, FullControl
Public propertyTransactional
Set true to create a transactional queue; false to create a non-transactional queue. Default is false;
Public propertyUseJournalQueue
Set to true to use the journal queue
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">
        <ItemGroup>
            <Allow Include="TFS">
                <Permissions>DeleteMessage,ReceiveMessage</Permissions>
            </Allow>
            <Deny Include="TFS">
                <Permissions>GetQueueProperties</Permissions>
            </Deny>
        </ItemGroup>
        <!-- Create queue -->
        <MSBuild.ExtensionPack.Communication.MSMQ TaskAction="Create" Path=".\private$\3" Label="Test Queue" Force="true"/>
        <!-- Check if the queue exists -->
        <MSBuild.ExtensionPack.Communication.MSMQ TaskAction="CheckExists" Path=".\private$\3">
            <Output TaskParameter="Exists" PropertyName="DoesExist"/>
        </MSBuild.ExtensionPack.Communication.MSMQ>
        <Message Text="Exists: $(DoesExist)"/>
        <!-- Delete the queue -->
        <MSBuild.ExtensionPack.Communication.MSMQ TaskAction="Delete" Path=".\private$\3"/>
        <!-- Check if the queue exists -->
        <MSBuild.ExtensionPack.Communication.MSMQ TaskAction="CheckExists" Path=".\private$\3">
            <Output TaskParameter="Exists" PropertyName="DoesExist"/>
        </MSBuild.ExtensionPack.Communication.MSMQ>
        <Message Text="Exists: $(DoesExist)"/>
        <!-- Delete the queue again to see that no error is thrown -->
        <MSBuild.ExtensionPack.Communication.MSMQ TaskAction="Delete" Path=".\private$\3"/>
        <!-- Create queue -->
        <MSBuild.ExtensionPack.Communication.MSMQ TaskAction="Create" Path=".\private$\3" Label="Test Queue" Force="true" Transactional="false" Authenticated="" MaximumQueueSize="220"/>
        <!-- Send Message -->
        <MSBuild.ExtensionPack.Communication.MSMQ TaskAction="Send" Path=".\private$\3" Message="Mike" Label="Hi2"/>
        <!-- Send Message -->
        <MSBuild.ExtensionPack.Communication.MSMQ TaskAction="Send" Path=".\private$\3" Message="" Label=""/>
        <!-- Set permissions -->
        <MSBuild.ExtensionPack.Communication.MSMQ TaskAction="SetPermissions" Path=".\private$\3" Allow="@(Allow)" Deny="@(Deny)"/>
    </Target>
</Project>
See Also

Reference