Tech Off Thread

4 posts

Namespaces in VB a question and and suggestion

Back to Forum: Tech Off
  • User profile image


    In C# when you create a new class, the IDE inserts namespace for you.  And the namespace is the folder structure in the solution.   Is this possible to do in VB ?    

    I know what namespaces in VB is different then C#, but it should be possible to insert a parameter into the templates to do this ? 

    Anybody done this ?  

    For future versions of VB I really hope they will include this.     We use namespaces in VB also  Smiley





  • User profile image

    @steinvk: you can wrap a class in the namespace/end namespace construct.  isn't that what you want?

  • User profile image

    You could update the wizards provided with Visual Studio.

  • User profile image

    Sorry if I was unclear   Smiley

    I want VB to behave like C# when I add a new class to my solution.

    i.e    I have a folder called   Views   in my solution.

    When I add a new class to the Views folder I want VB to insert

    namespace  Views

    public class MyNewClass

    End Class

    end namespace

    This is what C# does when you add a new class to a C# solution.

    I know that VB don't do this by default now and I haven't found a way to add this to the templates either




Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.