Project Layout (on disk) in Visual Studio

∥☆過路亽.° 提交于 2019-12-06 13:48:42

问题


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:

  1. The ASP.NET Web application project
  2. A business logic project (housing the majority of my buslogic classes)
  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!