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
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
Name | Description | |
---|---|---|
MSMQ |
Properties
Name | Description | |
---|---|---|
Allow |
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
| |
Authenticated |
Set to try to create an Authenticated queueu. Default is false
| |
Deny |
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
| |
Exists |
Gets whether the queue exists
| |
Force |
Set to true to recreate a queue if it already exists
| |
Label |
Sets the Label of the queue
| |
MaximumJournalSize |
Sets the maximum journal size in kb.
| |
MaximumQueueSize |
Sets the maximum queue size in kb.
| |
Message |
Sets the Message to send to the queue
| |
Path |
Sets the path of the queue. Required.
| |
Privacy |
You can specify whether the queue accepts private (encrypted) messages, non-private (non-encrypted) messages, or both. Supports Optional (default), None, Both.
| |
Revoke |
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
| |
Set |
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
| |
Transactional |
Set true to create a transactional queue; false to create a non-transactional queue. Default is false;
| |
UseJournalQueue |
Set to true to use the journal queue
|
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