I am trying to path msmq messages to a specific terminal server if the user session is in terminal server 1(TS1) then the message should queue to the local machine if the if in any other it should queue to TS1. My code is not quite correct I get a name error with this code. Can anyone help with the correct syntax?
If Environment.MachineName = "TS1" Then
toMyQueuePath = System.Configuration.ConfigurationManager.AppSettings("ToMyQueuePath")
_toMyQueue = New MessageQueue(toMyQueuePath)
_toMyQueue.Formatter = New XmlMessageFormatter(New Type() {GetType(XmlDocument)})
Else
toMyQueuePath = System.Configuration.ConfigurationManager.AppSettings("TS1\ToMyQueuePath")
_toMyQueue = New MessageQueue(toMyQueuePath)
_toMyQueue.Formatter = New XmlMessageFormatter(New Type() {GetType(XmlDocument)})
End If
Our community of experts have been thoroughly vetted for their expertise and industry experience.