none
Library Use Tool

    Question

  • Is there a tool which will walk solution code and list which libraries are in actual use or not in actual use by your code, other than by "using" statements, so you can remove the not in use libraries from your final code?
    Wednesday, November 30, 2016 10:47 AM

Answers

  • Hi AlaskanRogue,

    I still cannot find this kind of tool after checking the Visual Studio Gallery and searching it online. There are just some other tools with the similar function as the tool above in my first reply.

    So, I have not found any tools that could implement this idea. But your idea is reasonable, I’ve helped submit a feedback to User Voice and voted it, here the link where you can vote and comment it, I think engineers from Microsoft will evaluate this feature seriously:

    https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/17305867-tool-can-remove-the-library-not-used-from-referenc

    In addition, would you please mark the reply as the answer, which could help others, who has the same ideas as yours, to vote and comment it.

    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.

    • Marked as answer by AlaskanRogue Friday, December 02, 2016 12:14 PM
    Friday, December 02, 2016 5:27 AM
    Moderator

All replies

  • Hi AlaskanRogue,                                                                            

    I did find a tool which could remove the using statements in your code. Here is the link where you could download it:

    https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProductivityPowerTools2015

    There are two versions corresponding to vs2015 and vs2013 for you to choose.

    After the Productivity Power Tools installed, you would use it in your Visual Studio.

    I followed the steps below:

    Right-click the project name (in solution explorer) -> Power Commands->  remove and sort using

    There is no tools for you to delete the libraries under References, but you could do it by hand.

    Another suggestion might meet your need is to switch between Release and Debug. Because in debug mode, it will aid debugging as, the library will provide much more detailed messages for warnings and errors. But in case of release, only use Release version of library for linking

    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.

    Thursday, December 01, 2016 6:05 AM
    Moderator
  • Thanks for the reply Oscar.

    I am familiar with the "Remove Usings" functionality in VS; use it occasionally. I am also aware of the library switching between build types.

    I am really trying to reduce the payload and identity the libraries to remove under References as I am targeting mobile platforms. I am thinking a mapping tool might provide the info as no connection links should be present to the non-used libraries.

    Thanks again.

    Thursday, December 01, 2016 1:08 PM
  • Hi AlaskanRogue,

    I still cannot find this kind of tool after checking the Visual Studio Gallery and searching it online. There are just some other tools with the similar function as the tool above in my first reply.

    So, I have not found any tools that could implement this idea. But your idea is reasonable, I’ve helped submit a feedback to User Voice and voted it, here the link where you can vote and comment it, I think engineers from Microsoft will evaluate this feature seriously:

    https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/17305867-tool-can-remove-the-library-not-used-from-referenc

    In addition, would you please mark the reply as the answer, which could help others, who has the same ideas as yours, to vote and comment it.

    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.

    • Marked as answer by AlaskanRogue Friday, December 02, 2016 12:14 PM
    Friday, December 02, 2016 5:27 AM
    Moderator
  • Hi AlaskanRogue,

    After my above reply, I also do an in-deep analysis about your issue. Here is my opinions:

    First, if a namespace that could not be used in our project, we could use the default feature in VS, just like the following screenshot (hover the mouse to the yellow light-> then click the Remove Unnecessary Usings -> and all namespace will be removed):

    Second: there is another tools for us to remove unnecessary namespace (in my other computer), we could install ReSharer in VS, and click->Inspect->Code Issues in Solution:

    And unnecessary will be listed with the following screenshot:

    https://marketplace.visualstudio.com/items?itemName=JetBrains.ReSharper

    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.

    Friday, December 02, 2016 7:50 AM
    Moderator
  • Thanks Oscar.
    Friday, December 02, 2016 12:13 PM
  • Again, Thanks!!!
    Friday, December 02, 2016 12:14 PM