Thanks for your response Bill, but unfortunately it doesn't match what I'm asking.
If "try catch" worked then I wouldn't have posted my question in the first place.
Below is my original question...
I have an app that loops through a list of machines and queries their WMI database.
On some machines, WMI is not working correctly and as such my app "hangs" forever on the following line:
System.Management.ManagementObjectCollection oReturnCollection = oSearcher.Get();
How can I by-pass this if it fails? I'm using a "try" but it doesn't throw an exception when it hits this line and hangs.
At this point I don't care that WMI is not working, I just want my app to throw an exception via "catch" and continue to the next machine.