using directive with whole program scope

前端 未结 3 809
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-28 18:26

How can I have a using directive that has a scope of the whole program instead of just the file it is in. For every module that I use I would only want to set this once. If ther

3条回答
  •  情话喂你
    2021-01-28 19:11

    Having the using directives in each single .cs file allows you to take that file out of an existing project and drop it into another project, provided it has the same references.

    Also, adding using directives is basically automatic at this point. My tool of choice, ReSharper. Place the cursor on whatever class isn't recognized, press Alt+Enter, and the using directive gets added automatically. If there are multiple choices, you get to pick the right one.

提交回复
热议问题