Skip to content

Commit f710c5a

Browse files
committed
Enhance MSMQ installation step to create a test queue and check for existence
1 parent 9ab647f commit f710c5a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,21 @@ jobs:
2323
run: |
2424
Write-Host "Installing MSMQ feature..."
2525
Enable-WindowsOptionalFeature -Online -FeatureName MSMQ-Server -All -NoRestart
26-
Enable-WindowsOptionalFeature -Online -FeatureName MSMQ-HTTP -All -NoRestart
2726
Write-Host "MSMQ installation completed."
28-
Get-Service -Name MSMQ | Format-List *
27+
28+
Write-Host "Starting MSMQ service..."
29+
Start-Service -Name MSMQ
30+
Get-Service -Name MSMQ
31+
32+
Write-Host "Creating test queue..."
33+
[System.Reflection.Assembly]::LoadWithPartialName("System.Messaging") | Out-Null
34+
$queuePath = ".\Private$\myQueue"
35+
if (-not [System.Messaging.MessageQueue]::Exists($queuePath)) {
36+
[System.Messaging.MessageQueue]::Create($queuePath)
37+
Write-Host "Queue created: $queuePath"
38+
} else {
39+
Write-Host "Queue already exists: $queuePath"
40+
}
2941
3042
- name: Setup .NET
3143
uses: actions/setup-dotnet@v4

0 commit comments

Comments
 (0)