Remove unused references

后端 未结 6 1600
你的背包
你的背包 2021-01-01 10:50

I want to know if any tool exists for removing unused references (not unused using directives) within a .NET C# project.

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-01 11:22

    I am unaware of such a tool off the top of my head - I do know that Visual Studio does not include one by default. However, referenced assemblies that are not actually used by code in the project are automatically removed by the C# compiler from the list of assemblies referenced by the compiled program. If you use Reflector, you can compare the list of actual references to the list of references in the project, and remove the unnecessary ones that the project includes based on that.

提交回复
热议问题