Does C# Support Project-Wide Default Namespace Imports Like VB.NET?

前端 未结 4 977
旧时难觅i
旧时难觅i 2020-11-27 22:10

I am a recently converted VB developer to C#, but there is one thing thus far that I haven\'t been able to find. In VB when I setup a new project I can specify the namespace

4条回答
  •  醉话见心
    2020-11-27 22:37

    Others have suggested using templates etc. Personally I find it's just not a problem - I type the name of the class that I want to use into Visual Studio, and even if it's not found the "smart tag" (or whatever it's called) icon pops up. I hit Ctrl-. and it adds a using directive for me.

    I think ReSharper helps to make this work even better, but it's so automatic for me now that I don't really think about it much any more. (I suspect the difference is that with ReSharper I can hit Alt-Enter at any point in the line and it'll offer the correction, instead of having to have the cursor in the type name itself for Visual Studio.)

提交回复
热议问题