How do I get ReSharper’s "Remove Unused References" feature to work on references added through NuGet packages?
Hi Everyone. I am using Visual Studio 2015 to work on a multi-project solution in C#. I have a NuGet package (made up of multiple common libraries developed internally) that is installed on all the projects within the solution. All the projects now have references to each DLL that was included in the package regardless of a DLLs actual use by the project. This simplifies managing references for approximately 50 projects since I can be sure each project has the references it needs. The plan was to then follow up with ReSharper to remove the unused references. Unfortunately, it doesn’t seem to work.
Here are things I tried:
Here’s my setup:
Here is a link to the ReSharper help page for the feature: https://www.jetbrains.com/resharper/help/Refactorings__Remove_Unused_References.html
I’m running out of ideas for possible solutions and any help would be appreciated.
Thank you in advance!
It's going to be added in v10.1 (a.k.a. 2016.1), which is in early access right now:
Optimize References learns to handle NuGet references that are now displayed in the same tool window as all the regular references that a project contains. ReSharper also adds a new grouping to show possibly unused references that have dependencies in the project, and thus cannot be considered redundant.