R# doesn't like the simple Action type - Argument type 'lambda expression' is not assignable to parameter type 'Action'

Hi,
Just recently purchased R# and am loving it for most projects. However I'm running into a major pain while using a few APIs similar to this:

void DoSometing(Action action);

So in my app, if I use a simple lambda such as

App.DoSomething(() => { });

I get the "Argument type 'lambda expression' is not assignable to parameter type 'Action'"

It seems that R# responds to any of the Action<T> generics, but not the simple non-generic Action.

Any ideas how I can get this annoyance taken care of through a UI setting or workaround in R#? Thanks in advance!

4 comments
Comment actions Permalink

Hello Jeff,

Please make sure you have ReSharper 5.1.1753.4 installed (which is available
at http://www.jetbrains.com/resharper/download/index.html). Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi,
Just recently purchased R# and am loving it for most projects. However
I'm running into a major pain while using a few APIs similar to this:
void DoSometing(Action action);

So in my app, if I use a simple lambda such as

App.DoSomething(() => { });

I get the "Argument type 'lambda expression' is not assignable to
parameter type 'Action'"

It seems that R# responds to any of the Action<T> generics, but not
the simple non-generic Action.

Any ideas how I can get this annoyance taken care of through a UI
setting or workaround in R#? Thanks in advance!

---
Original message URL:
http://devnet.jetbrains.net/message/5279328#5279328



0
Comment actions Permalink

Hi,

Yes, I've installed (and now reinstalled) the latest and see this behavior.

0
Comment actions Permalink

Hello Jeff,

Could you please attach a small sample solution demonstrating this behavior?
Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi,
Yes, I've installed (and now reinstalled) the latest and see this
behavior.
---
Original message URL:
http://devnet.jetbrains.net/message/5279536#5279536



0
Comment actions Permalink

Hi,
I've finally solved this.

Turns out it is unique to the Windows Phone development environment.

Not having a reference to System.Core 2.0.5.0 (the Silverlight version vs full .NET) in the project is fine, as it was a special case for the phone tools. This confused R#.

If I manually edit the project to include System.Core, the warnings go away, but I receive a warning from the phone tools every time I open a project, to the effect of "this may not work with your project."

Sorry for the trouble, hope others can search for this if they hit it.

-Jeff

0

Please sign in to leave a comment.