1

The title pretty much sums it up:

ReSharper claims various members are unused, when they are actually used as Model members in cshtml views.

I got carried away removing unused members in my code the other day (as suggested by ReSharper) only to determine that these members were actually totally necessary.

I use Visual Studio 2010, ReSharper Ultimate 2015.1, MS MVC 3, .NET 4.

Are there any elegant ways of getting ReSharper to stop tempting me to remove code that is used in the view?

Brian Sweeney
  • 6,693
  • 14
  • 54
  • 69
  • 1
    Does [this](http://stackoverflow.com/questions/2875858/how-do-i-tell-resharper-that-an-attribute-means-that-a-method-is-used) help ? – Thomas Ayoub Jun 17 '15 at 13:39
  • 1
    possibly related: http://stackoverflow.com/questions/3063844/how-to-resolve-resharpers-unused-property-warning-on-properties-solely-for-di – Kritner Jun 17 '15 at 13:39
  • @Thomas - good suggestion. I'm going to let some time go by and then if nothing less labor intensive pops up maybe we should either mark this as a dupe, or create an answer reflecting your contributions or something like that. Thanks! – Brian Sweeney Jun 17 '15 at 14:33
  • and @Kritner - same comment as above. Thanks! – Brian Sweeney Jun 17 '15 at 14:33
  • Better to raise ticket at https://youtrack.jetbrains.com/issues/RSRP with code examples how model used in views. – derigel Jun 18 '15 at 08:45
  • @derigel that's an interesting idea - do you believe that this behavior is erroneous? at first it hadn't occurred to me, but after using it a bit more i found that it was correctly refactoring cshtml files and cs files which used the same c# objects. i wonder if there is some intermittent bug? i would like to hear what other resharper users have experienced before i cry wolf. – Brian Sweeney Jun 18 '15 at 14:16

0 Answers0