Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB.NET Project Folder Question

So if I am working on a project in VB.net (really any visual studio project), I am able to create folders. My project is getting rather unweildy (over 30 classes) and I think it would be beneficial to store for example data structure classes in a folder "ds" and user controls in a folder "uc". Is this OK? Will it affect the way I reference the classes? Are the folders simply for my own use and structure or do they actually have some kind of impact on my project as a whole?

PS in case you are confused, I am referring to the structure shown in the "Solution Explorer". Sorry if this is a dumb question or not clear, but I have never worked on a large project like this before.

like image 832
Kevin Avatar asked Jun 27 '11 21:06

Kevin


People also ask

How do I add an existing folder to Visual Studio 2010?

Adding FilesRight click the project or contained folder and choose Add | Existing Item... . Use Show All Files . Click on files or folders you would like to add to the project and choose Include In Project . Drag and drop files and folders from Windows Explorer.

How to import a form from another project in VB net?

Select Visual Studio menu Project -> Add Existing Item... Then select (browse) in the file dialog the Form. cs (Form = name of the form) you want to add to the project and the form (with all associated files) is (copied and) added to your project.


1 Answers

There's no such thing as dumb questions. ;) You can do this, but do yourself a favor and keep your namespaces the same as your folder hierarchy or you can end up with a bird's nest pretty quickly. For example, if the project's default namespace is MyProject and the folder is Dc, those classes should be in

Namespace MyProject.Dc

Edit: Just wrap your classes to mirror your folder structure like:

Namespace MyProject.Ds
    Module MyModule

        Sub Main()
            'do stuff here
        End Sub

    End Module
End Namespace
like image 137
orkutWasNotSoBad Avatar answered Oct 14 '22 14:10

orkutWasNotSoBad