none
How to Know Which References Are No Longer Needed

    Question

  • I've refactored my application a number of times, in the process walking away from some capabilities that I had been using.  The result is that I think I have some project References that I no longer need, but don't know how to determine that without removing them and seeing what goes haywire.  Not the best approach, I'm hoping.  So, how can I tell which References are no longer needed?
    Monday, February 6, 2017 8:00 PM

Answers

All replies

  • I actually think that's a fine approach.  Either nuke everything and then add in the ones that the compiler says are necessary; or remove one by one and see if each breaks the build.  I'm sure there's a binary search type approach that will reduce the number of builds you have to do to correctly guess the set of essential references.

    There may be extensions that do this.  See http://stackoverflow.com/questions/3157066/removing-all-unused-references-from-a-project-in-visual-studio-projects

    • Marked as answer by Cincy Steve Monday, February 6, 2017 10:21 PM
    Monday, February 6, 2017 8:15 PM
  • Given all the dialog in the link you provided, it's surprising a more native approach doesn't exist. Anywho, thanks for the suggestion. I'll go the brute force route since this isn't a recurring need.
    Monday, February 6, 2017 10:21 PM
  • Hi Cincy Steve,

    Thank you for marking a useful answer, which could be helpful for others. :)

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, February 7, 2017 6:19 AM
    Moderator