I am starting to get really pissed about this problem now...
I have a function, worker_DoWork used by a backgroundworker. Something is wrong with it though. When it has run to the end it just runs one more time.
I have stepped the code and what I can see the background worker jumps straight from the closing bracket to the start again...
I have breakpointed all places that could have started it again but nope they didn't trip. Not even the worker.RunWorkerAsync() which should be the only right way to start it.
Is there a way to step through ALL the lines that is being executed? There must be a line somewhere that gets executed but I can't find it
If you have a breakpoint at the point it restarts, you will see in the Call Stack window all the function calls all the way back to the entry point of the application. You can double-click on those stack frames to switch the debugging "view" to that frame, and see all the local variables (local to that frame) etc.
Yes and no, it was resolved but the issue showed up again
Great tip, exactly what I need though I don't know how to use it quite :/
If I double click a line it opens a page where it says No Source Found.
Here is a screenshot on the callstack on a breakpoint at the opening bracket of the DoWork the second time it is run: http://s246.photobucket.com/albums/g...krmklipp-2.png
This is how the program misbehaves:
I start the worker
The DoWork is run
The RunWorkerCompleted runs
Now, if I don't close the program and continue this happens:
I start the worker
The DoWork runs
The DoWork runs again
The RunWorkercompleted runs
The RunWorkercompleted runs again
If I continue even further:
I start the worker
The DoWork runs
The DoWork runs again
The DoWork runs again!
The RunWorkercompleted runs
The RunWorkercompleted runs again
The RunWorkercompleted runs again!
And so on, one more time for each thing each time I repeat...weird!
I have written an own class for managing the backgroundworker, I can write it here if you want. I have breakpointed the only worker.RunWorkerAsync() and it only executes the first time when I want, the rest happens magically....
I suspect you're registering an event each time - which means the event gets registered according to the number of times you clicked. Post your code - I'll glance at it. =)
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
Some things maybe don't look that good in this code, for example the custom events, I put them there in like 10 minutes yesterday night in a hurry (the problem was before that of course), and so on. Just break down on the part that ****s it up
I suspect you're registering an event each time - which means the event gets registered according to the number of times you clicked. Post your code - I'll glance at it. =)
LR got it:
csharp Code:
public void Start()
{
worker.DoWork += new DoWorkEventHandler(worker_DoWork);
worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);