Removing all unused references from a project in Visual Studio projects

前端 未结 14 2084
北荒
北荒 2020-11-29 16:41

I just wondered if it possible within various Visual Studio versions to automatically remove all references from a project that were never been used?

In your answer,

14条回答
  •  感情败类
    2020-11-29 17:30

    All you need is stone and bare knuckle then you can do it like a caveman.

    1. Remove unused namespaces (for each class)
    2. Run Debug build
    3. Copy your executable and remaining namespace references to new location
    4. Run the executable
    5. Missing Reference DLL error will occur
    6. Copy required DLL from Debug folder
    7. Repeat 4-6
    8. Gu Gu Ga Ga?
    9. Throw your stone

    You can also rely on your build tools to let you know which reference is still required. It's the era of VS 2017, caveman still survived.

提交回复
热议问题