ReSharper 5.1.1 doesn't play well with Unity

I just upgraded to ReSharper 5.1.1 and it feels like a downgrade.  There are many spurious warnings that 5.1 did not include.  The most noticeable stems from the use of the Unity IOC container.  If I declare an interface, implement the interface on a class, and then do the following:

     MyUnityContainer.RegisterType<IFoo, Foo>();

ReSharper claims that "Class 'Foo' is never instantiated" when it clearly is.  I've noticed a number of other problems with bad warnings about stuff not being used when it CLEARLY is (example: if I use two way data binding in XAML to an IOC injected implementation of a view-model, I'm seeing a lot of setter is never used and can be made private  -- clearly it's used because it participates in two way data binding!).

I'm off to go downgrade to R# 5.1. :(

2 comments
Comment actions Permalink

Hello,

Could you please attach a small sample solution demonstrating those problems?
Do I understand correctly that using the class Foo through MyUnityContainer.RegisterType<IFoo,
Foo>(); only did not result in 'Class Foo is never instantiated' warning
with ReSharper 5.1? Thank you!

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

I just upgraded to ReSharper 5.1.1 and it feels like a downgrade.
There are many spurious warnings that 5.1 did not include.  The most
noticeable stems from the use of the Unity IOC container.  If I
declare an interface, implement the interface on a class, and then do
the following:

MyUnityContainer.RegisterType<IFoo, Foo>();

ReSharper claims that "Class 'Foo' is never instantiated" when it
clearly is.  I've noticed a number of other problems with bad warnings
about stuff not being used when it CLEARLY is (example: if I use two
way data binding in XAML to an IOC injected implementation of a
view-model, I'm seeing a lot of setter is never used and can be made
private  -- clearly it's used because it participates in two way data
binding!).

I'm off to go downgrade to R# 5.1.

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



0
Comment actions Permalink

Here you go.  R# 5.1.1 claims that the class ActualViewModel is never instantiated.  I think it's also going to say that ActualViewModel.MyText.set can be made private, but I'm not certain since I've since moved back to 5.1.

edit: I should say this is a VS2010 solution that targets Silverlight 4.



Attachment(s):
SilverlightApplication3.zip
0

Please sign in to leave a comment.