using directive with whole program scope

前端 未结 3 905
佛祖请我去吃肉
佛祖请我去吃肉 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:03

    Sorry, but what you are trying to achieve is not possible and I don't think that there are any workarounds. This is supported for example in WebForms or Razor views where you could declare common namespaces in the section of your web.config but unfortunately such artifact doesn't exist for standard C# files.

提交回复
热议问题