开发者

Prevent Visual Studio from removing certain using directives

I frequently use the "Remove and sort usings" feature of VS/PowerCommands - in fact, with the help of R#, I make VS do this for me every time i save the document, which I almost reflexively do almost every time I finish writin开发者_C百科g a code line without errors.

However, there are a couple of namespaces that, if they are there, I don't want to remove.

Mainly, this concerns System, System.Linq and System.Web.Collections.Generic, but there are others too, and the specification of exactly which namespaces are concerned will likely change in the future.

Is there any way to tell this feature that "If you see this or that namespace and it's not used at the moment, never mind. I'll remove it manually."?


There is no way. You could write your own visual studio extension but I don't know the reason to do that. If it is because you don't like to write using lines you can use the alt+shift+f10 shortcut that it writes it for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜