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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With