I get the exception when executing the following code. Any ideas what is wrong?
string queueName = \"FormatName:Direct=TCP:1.1.1.1\\\\Private$\\\\test\";
Message
The answer above with checking the exception message does work on systems that raise English-exceptions. My system raises Dutch-exceptions. I get "De time-out voor de gevraagde bewerking is verstreken." So it's not a very robust solutions The exception has a property MessageQueueErrorCode that should be used to check whether or not an IOTimeout occurred.
So it's better to use
return (ex.MessageQueueErrorCode == MessageQueueErrorCode.IOTimeout);
instead of:
return ex.Message.StartsWith("Timeout");