How can I make my VS2017 automatically add namespaces to new *.vb files?
I tried to create new item templates using $itemfolder$
, but it doesn't work:
Template
Namespace $itemfolder$
Public Class $safeitemrootname$
End Class
End Namespace
Output
Namespace $itemfolder$
Public Class MyClass2
End Class
End Namespace
Using the $rootnamespace$
parameter, it doens't work as I'm expecting:
Template
Namespace $itemfolder$
Public Class $safeitemrootname$
End Class
End Namespace
Output
Namespace ConsoleApp1
Public Class MyClass
End Class
End Namespace
Solution Explorer
I was expecting the namespace to be ConsoleApp1.TestNamespace
or TestNamespace
in that case.
Is there any way to VS2017 automatically add namespaces to my new classes? I also know that Resharper can do this job, but I'm looking for a free solution.