Remove unused namespaces across a whole project or solution at once

前端 未结 10 1942
夕颜
夕颜 2020-12-25 09:46

I know you can do it file by file.

Is there any way to do this in one step for all files in a project?

10条回答
  •  执念已碎
    2020-12-25 09:54

    I am using Visual Studio 2015 and found a tool named BatchFormat: https://marketplace.visualstudio.com/items?itemName=vs-publisher-147549.BatchFormat

    This did the job perfectly.

    Install the tool, then right click on your solution in the solution explorer, then at the top of the menu you see batch format:

    Whatever you select is applied to every file in your solution, as you can see in the screenshot, there are other options, you can also format every document.

提交回复
热议问题