I have a situation where I'm using BackgroundWorker to run a long process in the background. However, whenever it runs I keep getting the following error:
"TargetInvocationException was unhandled"
The culprit seems to be this guy:
Expand|Select|Wrap|Line Numbers
- Dim GrainProcess As New Process()
I tried putting the Dim statement outside the sub, but then it just gives me the same error a couple of lines down when I try to set the .StartInfo properties.
Does the "was unhandled" part of the above exception mean that I need to provide some kind of error checking (maybe a try...catch), or does it mean that I'm not allowed to do a Process.Start from within a BackgroundWorker thread?
I'm pretty new to threading in general, so any help would be greatly appreciated. Code examples would be very helpful, since I'm not a programmer by nature and can't always make heads or tails out of what I read in the Microsoft Documentation.
Please also let me know if you need any additional info.
Thanks for your time!