views:

64

answers:

1

When using Resharper, for some reason, when I call an extension method, it automatically converts it into a static method call. This is the so called Convert Extension Method to Plain Static refactoring.

foo.Bar()

becomes

MyStaticExtensions.Bar(foo);

Ironically, it then flags this as a code smell. How do I turn this off?

+1  A: 

That doesn't happen for me (Resharper 4.5). Do you have "silent clean up" enabled? (Resharper - options - Code Cleanup).

Nader Shirazie
Nope, it doesn't look like I have any cleanup profiles set up. This actually only happens in a particular circumstance. Namely a Linq To SQL extension method defined in a partial class.
Charles Graham
@Charles: ok, that makes more sense (that its a particular circumstance). I'll try to repro...
Nader Shirazie