Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 938409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:38:21+00:00 2026-05-15T21:38:21+00:00

When adding a new item (class, control, etc) in C# it will automatically add

  • 0

When adding a new item (class, control, etc) in C# it will automatically add a namespace to the file depending on the location in the project.

Is this also available for VB.NET?

The code ‘Namespace DataClasses.AX’ and ‘End Namespace’ would be generated.

Namespace DataClasses.AX
    <Serializable()> _
    Public Class AxInventItem

#Region " Constructors "
        Sub New()

        End Sub
#EndRegion
    End Class
End Namespace
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:38:22+00:00Added an answer on May 15, 2026 at 9:38 pm

    You dont say what version of visual studio you are using, but it is doable by default with VS2008.

    Goto : C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\VisualBasic\Code\1033\Class.zip
    (if this doesnt exist i will post you the contents of mine).

    Inside you will find two files: Class.vb and Class.vstemplate

    Open Class.vb (i extracted it and edited in notepad++ but anything will do).
    Change it to read:

    Namespace $itemfolder$
    
        Public Class $safeitemname$
    
        End Class
    
    End Namespace
    

    Shut Visual stuid (all instances)

    Save and replace the one inside the zip.

    Openup a command prompt (easiest is to use the visual studio command prompt), and run the following:

    devenv.exe /InstallVSTemplates
    

    Open Visual Studio again, create a blank project and add a folder to the project, and add a class inside the folder and you will have your namespace automagically added to your class file.

    Edit

    Class.vb:

    Namespace $itemfolder$
    
        ''' <summary>
        ''' 
        ''' </summary>
        ''' <remarks>Class Created by $username$ on $date$</remarks>
        Public Class $safeitemname$
    
        End Class
    
    End Namespace
    

    Class.vstemplate:

    <VSTemplate Version="3.0.0" Type="Item" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
      <TemplateData>
        <Name Package="{164B10B9-B200-11D0-8C61-00A0C91E29D5}" ID="3020" />
        <Description Package="{164B10B9-B200-11D0-8C61-00A0C91E29D5}" ID="3021" />
        <Icon Package="{164B10B9-B200-11D0-8C61-00A0C91E29D5}" ID="4510" />
        <ProjectType>VisualBasic</ProjectType>
        <SortOrder>100</SortOrder>
        <DefaultName>Class.vb</DefaultName>
        <NumberOfParentCategoriesToRollUp>1</NumberOfParentCategoriesToRollUp>
        <TemplateID>Microsoft.VisualBasic.Code.Class</TemplateID>
        <RequiredFrameworkVersion>2.0</RequiredFrameworkVersion>
      </TemplateData>
      <TemplateContent>
        <ProjectItem ReplaceParameters="true">Class.vb</ProjectItem>
      </TemplateContent>
      <WizardExtension>
        <Assembly>VBClassTemplateWizard, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=f12a64f29cf5aee5</Assembly>
        <FullClassName>VBClassTemplates.VBClassReplacements</FullClassName>
      </WizardExtension>
    
    </VSTemplate>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am adding a new item to the bottom of a UITableView and after
I am writing a view controller for adding a new item to my app.
I have a jqgrid with the add dialog enabled for adding new rows. The
In VS2008, I am adding new classes to a web project. When I right-click
How can I animate adding new item or moving item from one position to
Related to this: Adding new items dynamically to IQueryable hard-coded fake repository How could
How can I add a new object item to a Main Views model that
Now I can add items with store.newItem() . After adding it, it's placing it
How do I adding new aloha-button in aloha-multisplit-expanded box. (I want the ability to
I have trouble with adding new row to my UITableView. I read similar questions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.