Click here to Skip to main content
15,878,602 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
It is very puzzling. I have two copies of a c# project. Exact same code in both. The only difference is one project has A.dll as a reference, the other has B.dll as a reference. Project A works fine, and bw_DoWork is executed. Project B: it does not stop at a breakpoint in bw_DoWork. I cleaned and rebuilt B.dll. I also cleaned the c# solution and rebuilt it. What possible cause would there be for such behavior? I have the DoWork wired uup with bw_DoWork. I've googled a lot but no help.
thanks,
sb


C#
private void button1_Click(object sender, EventArgs e)
{
    if (bw.IsBusy != true)
    {
        bw.RunWorkerAsync();
    }
}



private BackgroundWorker bw = new BackgroundWorker();
public Form1(EccTask newTask)
{
    InitializeComponent();

    if (newTask == null)
    {
        textBox1.Text = "No task data";
        return;
    }

    NewTask = newTask;

    bw.WorkerSupportsCancellation = true;
    bw.WorkerReportsProgress = true;
    bw.DoWork += new DoWorkEventHandler(bw_DoWork);
    bw.ProgressChanged += new ProgressChangedEventHandler(bw_ProgressChanged);
    bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);



}


C#
private void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            
            BackgroundWorker worker = sender as BackgroundWorker
            ...
         }
Posted
Updated 20-May-13 11:11am
v3
Comments
Sergey Alexandrovich Kryukov 20-May-13 18:16pm    
Not enough information. How do we know that, say, was ever added as an event handler to appropriate button's Click event invocation list? And so on. Show "+=" operators.
You should simplify project as much as you can and reproduce the problem, but the project should be complete. The problems are often in tiny detail.
—SA
bonosa 20-May-13 21:24pm    
Thank you Sergey! The code steps into the button click event with no problem. It is wired to the Click event.
ClochardM33 24-May-13 15:42pm    
I know its no help, but I have exactly the same scenario in a VB app.
With a certain dll, no work.
Without dll, work.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900