Re: unhandled exception of type 'System.InvalidOperationException' occurred in System
Originally Posted by PHChang
Yes, that was what I did. However, still cannot figure out the root cause.
Does your program process incoming data from the network or a port? If so, the handler that processes the data is running on a different thread. Notice that you may not have explicily created the thread yourself, but it may have been done for you. At any rate inside the handler is where you are trying to use the control and the error is telling you that the control was created on a different thread. You need to access the control with the Invoke method as suggested.
Re: unhandled exception of type 'System.InvalidOperationException' occurred in System
Thanks for your advice. Yes, my program is processing incoming data from network. I have no idea how to get access to the control with the Invoke method as suggested. However, if I tried to debug using remote debugging, I will not see this issue.
The problem with remote debugging is that I am having problem stepping into code that has breakpoint set.
It showed the message "The breakpoint will not be currently hit. No executable code is associated with this line. Possible causes include: preprocessor directives or compiler/linker optimization" (as shown in the picture I attached)
I did copied the pdb file over to the remote PC for debugging. Just wondering what I am missing here.
If cannot use the debug mode, I can only add logging for troubleshooting issues with my program for the time being.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.