0
How to make Visual Studio 2017 + VB.NET create new classes already with namespace, as it does in C#?
I’ve tried creating and editing item templates using the parameter $itemfolder$, but it doesn’t seem to work:
Template
Namespace $itemfolder$
    Public Class $safeitemrootname$
    End Class
End Namespace
Exit
Namespace $itemfolder$
    Public Class MyClass2
    End Class
End Namespace
Already using the parameter $rootnamespace$, does not work as it should:
Template
Namespace $itemfolder$
    Public Class $safeitemrootname$
    End Class
End Namespace
Exit
Namespace ConsoleApp1
    Public Class MyClass
    End Class
End Namespace
Solution Explorer
I was hoping the namespace was ConsoleApp1.TestNamespace or TestNamespace.
Have some way to get VS2017 to automatically add namespaces to new VB.NET classes?
I know Resharper works, but he gets paid.


The focus was on VS automatically filling the namespace in class creation as in C#. It could be with
$itemfolder$, that would look something like Project Name.Pasture1.Pasture2 or Pasture1.Pasture2 (in case VB.NET treats namespaces differently than C#). In tests, VS2013 worked these Item templates.– vinibrsl
I tried this on VS2017, it did not work, it gave syntax error: http://prntscr.com/fv881h
– CypherPotato