views:

319

answers:

1

In Silverlight, System.Windows.Threading's Dispatcher.BeginInvoke() takes an Action<T> or a delegate to invoke.

.NET allows me to pass just the lambda expression. but ReSharper sees it as an error, saying "Cannot resolve method 'BeginInvoke(lambda expression)'": Dispatcher.BeginInvoke(() => { DoSomething(); })

The error goes away if I explicitly create the Action around the expression like this: Dispatcher.BeginInvoke(new Action<object>(o => { DoSomething(); }));

I prefer the least amount of code in this case for the best readability. Is there a way to disable this specific ReSharper error notification? I tried some of the options, but could not find it.

Thanks, Carl

+4  A: 

Right now ReSharper 5 has problems with Silverlight 4. All of these issues will be handled in the bugfix update.

The root of these problems is that SL3 and SL4 mscorlibs have different types defined in, but the same Full Assembly Name.

xvost
Any idea when this will be out? This is something I reported when it first went public, and they have said that others have reported this. I am just not sure how long it take for them to get patches out.
TravisWhidden
This is fixed in the current EAP of 5.1 (which is free)
BarrettJ