How to stop ReSharper from displaying an error in a lambda expression where action is expected?

Silverlight System.Windows.Threading Dispatcher.BeginInvoke() requires an Action<T> or delegate to call.

.NET allows me to pass only a lambda expression. but ReSharper sees this as an error, saying "It is impossible to resolve the BeginInvoke (lambda expression)" method: Dispatcher.BeginInvoke(() => { DoSomething(); })

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

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

Thanks Carl

+4
source share
1 answer

ReSharper 5 currently has issues with Silverlight 4. All of these issues will be handled in the patch update.

The root of these problems is that SL3 and SL4 mscorlibs have different types defined in, but the same fully qualified assembly name.

+5
source

Source: https://habr.com/ru/post/1307430/


All Articles