Lots of false negatives in VS2017 solution

Resharper says this property can be made private, despite it being used:

Resharper says these enum elements are never used, despite them being used:

 

Resharper says this class is never instantiated, despite it being instantiated:

 

Resharper says this property is never used despite it being bound in my xaml

Resharper says this class is never instantiated, despite being instantiated

I think this all stems from the fact that it thinks MainViewModel is never instantiated since it's instantiated via an IoC container. I have marked [UsedImplicitly] on MainViewModel so shouldn't resharper now think that it is used and not warn that everything else is unused that leads from MainViewModel ???

 

Thanks,

 

 

0
3 comments

I had a similar problem in another context. I solved it by using the [UsedImplicitly] attribute on every method, which is a bit annoying.

0

AFAIK, the [UsedImplicity] attribute only applies to the attributed item by default. The class should be marked as "used", but not the members.

Try adding [UsedImplicity(ImplicitUseTargetFlags.WithMembers)] to the class instead.

1

Hi Richard,

thanks for the tip. I ask myself why i didn't used the marvellous R# intellisense in this case :-((

Regards

Andreas

0

Please sign in to leave a comment.