Looking for Alternative(s) to "Remove Unused References" for .Net Framework projects

Art Hansen 571 Reputation points
2022-01-11T12:30:42.267+00:00

Dev Environment: .Net Framework 4.7.2 using Visual Studio 2022 on Win 10 Pro 212H x64

Working on a C# winforms project. I'm nearing the end of the development phase and need to clean -up the References. Unfortunately the VS function "Remove Unused References" is only available to "SDK .csproj projects" (54801).

Is there another way to identify unused References?

Thank you in advance.
Art

Developer technologies | Visual Studio | Other
Developer technologies | C#
0 comments No comments
{count} votes

Accepted answer
  1. Sreeju Nair 12,666 Reputation points
    2022-01-13T05:55:48.96+00:00

    I recommend you to perform a search in Visual Studio Marketplace and evaluate them. In a quick search I found one, that is avaialble for free.

    https://marketplace.visualstudio.com/items?itemName=spongman.RemoveUnusedReferences

    https://marketplace.visualstudio.com/search?term=remove%20referrences&target=VS&category=All%20categories&vsVersion=&sortBy=Relevance

    Hope this helps


1 additional answer

Sort by: Most helpful
  1. Sreeju Nair 12,666 Reputation points
    2022-01-12T05:55:33.077+00:00

    Basically the default "Remove Unused References" currently only works with newer SDK style projects. There are requests by community to the product team to add this to other project types also, however as we speak it is not available there.

    So your option is to use any third party extension that does this. One of such extension is ReSharper from JetBrains. Please refer the below urls for more information.

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

    https://www.jetbrains.com/help/resharper/Refactorings__Remove_Unused_References.html

    Hope this helps.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.