tags:

views:

79

answers:

3

We have some piece of code that behaves differently in two .NET versions: * 3.0.30618 (latest .NET 3.0 version) * 3.0.04506 (.NET 3.0 RTM)

It does not work in the RTM version. We traced the problem to a call to system.windows.threading.dispatcher.BeginInvoke. The delegate passed never ran.

Any tips or suggestions for solving this issue?

A: 

The RTM is a early version of the framework. This means it's not entirely stable, and that it's incredibly likely this is a bug. Considering how long .NET 3.0 has been around in release form, my suggestion for solving this 'issue' is quite simply update .NET.

Ignore this, but I'm going to leave the answer itself so the comments survive.

Matthew Scharley
"RTM" isn't pre-release - it's "release to manufacturing".
Jon Skeet
RTM means release to manufacturing. So it's full...
Kieron
My mistake. I didn't know what it stood for, and google wasn't particularly helpful except for a few references in conjunction with betas.
Matthew Scharley
+1  A: 

I strongly suspect it's a bug somewhere in your code, even if it is a difference between the original .NET 3.0 and a later release.

I suggest you tackle it like any other problem: whittle down your code to the bare minimum to show the problem. Then it should be relatively clear whether it's a framework bug or something wrong in your own code.

Jon Skeet
Found the problem (I posted the answer). Now the bug is somewhere in our code, an exception was silently handled (gasp!).
moogs
+1  A: 

Found the problem.

With .NET 3.0 ( 3.0.04506 ), BeginInvoke had the following overloads:

  1. Dispatcher.BeginInvoke(DispatcherPriority, Delegate);
  2. Dispatcher.BeginInvoke(DispatcherPriority, Delegate, Object);
  3. Dispatcher.BeginInvoke(DispatcherPriority, Delegate, Object, Object[]);

With 3.0 SP2 ( 3.0.30618 ), the following were added.

  1. Dispatcher.BeginInvoke(Delegate, Object[]); <--- we were using this one
  2. Dispatcher.BeginInvoke(Delegate, DispatcherPriority, Object[]);

When ran on a machine with the RTM version of .NET, since the method isn't there yet, a MissingMethod exception is thrown, so the delegate was never executed.

The solution right now is to use the "old" overload : Dispatcher.BeginInvoke(DispatcherPriority, Delegate);

Now, this really sucks. No one can ever use the new overloads and sleep at night. Now to hunt why the exception was silently handled...

Thanks everyone!

moogs
I don't see why you'd be getting a MissingMethodException... the method's still there isn't it? Confusingly enough, the "old" overloads don't appear in my offline MSDN...
Jon Skeet
The method isn't there for there RTM version of .NET. Thats the environment where the delegate was not running.
moogs