How to automatically add namespaces in Visual Basic?

Asked

Viewed 99 times

6

When creating any class in C#, using Visual Studio, it automatically adds the namespace, as can be seen below:

namespace Aplicacao.Modelo
{
    class Cliente
    {
    }
}

In Visual Basic, he doesn’t do the same:

Public Class Cliente    
End Class

The result I was hoping for was:

Namespace Aplicacao.Modelo    
    Public Class Cliente 
    End Class    
End Namespace

Is there any way to make VS do the same for VB?

1 answer

6


You must look at these two ways:

\*VisualStudioInstallationDirectory*\Common7\IDE\ItemTemplates\*Language*\Code\*Locale*\

\*VisualStudioInstallationDirectory*\Common7\IDE\ProjectTemplates\*Language*\Code\*Locale*\

What is in between asterisks is variable. Obviously you need to search where your VS was installed (the version will also vary there). The Language is the language of template, in general will be CSharp or VisualBasic, which is the one you want. The Locale is a code according to the language (spoken) used, in general is the 1033.

It’s all there that VS takes to start something ready. Edit as you want, inside the format. You have to learn the variables of template. You can look as it is in C# to copy p/ o VB.NET.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.