问题
What's the best way to manage the physical layout of a Visual Studio project on disk? I'm getting to the point where I have several folders but I can't really continue categorizing the way I am now. For example, I have several custom controls, but sometimes those controls have to do with application settings, so do they go into the Controls folder or Application Settings folder? I have many full-fledged forms that reside in the main source folder so that it's getting a bit daunting looking for the right source file.
Are there any tips anyone can offer on how they organize their medium-sized projects into folder hierarchies so they don't go insane trying to locate something in the project?
回答1:
I typically organize my folders based on my namespaces. For example, classed in the namespace "Company.Project.DataAccess" would be stored in company/project/dataAccess directory.
I admit that this is still slightly painful to manage opening files. However, Resharper's "Go to type" feature has eliminated all of my searching in Solution Explorer.
回答2:
This is the hierarchy I typically use in medium sized projects.
A solution file consisting of 3 projects:
- The ASP.NET Web application project
- A business logic project (housing the majority of my buslogic classes)
- A database project (for housing my create scripts, stored procedures, etc.)
I'll have a forth project if I'm using custom WebControls. Within the Web app project, I'll have the usual folders such as css, images, includes, scripts, etc, as well as a folder for user controls if I'm using them. I almost always store my app settings in the Web.config.
来源:https://stackoverflow.com/questions/1009403/project-layout-on-disk-in-visual-studio