Link to home
Start Free TrialLog in
Avatar of JoeDW
JoeDW

asked on

C# Directory Structure and File Organization

I know this question is probably a waste of a lot of peoples time but being that I am very anal retentive I cannot let it go. Pretty much on a day to day basis I wrestle around with different ideas about how I want my folders and files to look for my C# and .NET projects. I cannot decide and was hoping someone out there could finally give me some peace.

This is what I have right now, its two seperate structures but I cannot decide on what to use:

ASP Web Forms

./
-  /Clients
-- /Client Name
---   /Backups
---   /Documents
---   /Visual Studio
----    /WebApps
-----      /sitename.com
----    /Library
-----     /SiteClassLibrary

Or this is what I started using for my winforms and console applications

./
- /project name
--  /src
---    /bin
---    /debug
--  /lib
---   /dll

Any thoughts? I just can't help it, stuff like this honestly makes me lose sleep at night. I just want to have it as organized as possible

Thanks in advance for any help, I appreciate it.
Avatar of SteveH_UK
SteveH_UK
Flag of United Kingdom of Great Britain and Northern Ireland image

I think you should organise it as follows:

1.  Use the 4-tier model of Client, Contract, Solution, Project
2.  If you are creating generic code, substitute your company for Client
3.  Create backups of work at the Contract level
4.  Store Client-centric documents at the Client level
5.  Store Contract-centric documents at the Contract level
6.  Use version control systems (such as CVS or Visual SourceSafe) for the Solutions and Projects
How you organise a development machine does not need to be identical to how you organise it from a medium-to-long-term perspective.  Often these environments are different.

And of course, it is always a matter of choice.  The advantages of the above are:

1.  Clients and individual contracts can be archived when work is complete, without affecting other projects
2.  Individual contracts can support multiple VS solutions and multiple projects per VS solution
3.  There is an appropriate place to store documents for both client and contract
4.  Code development is protected by version control
5.  You can reuse code as necessary by project imports, but you should not be linking code between clients, and this model supports that view.  It enables generic code to be compiled into separate solutions and projects that can then be referred to by other projects as needed, as well.
Avatar of JoeDW
JoeDW

ASKER

SteveH,

That sounds great, the first answer is what I am looking for. But what would Contract mean or what would it be in the folder structure?
Avatar of JoeDW

ASKER

Or is it the client name or company name?
ASKER CERTIFIED SOLUTION
Avatar of SteveH_UK
SteveH_UK
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JoeDW

ASKER

Wonderful, thank you for your help.