Solved

C# Directory Structure and File Organization

Posted on 2007-12-05
6
3,534 Views
Last Modified: 2013-12-16
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.
0
Comment
Question by:JoeDW
  • 3
  • 3
6 Comments
 
LVL 19

Expert Comment

by:SteveH_UK
ID: 20417806
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
0
 
LVL 19

Expert Comment

by:SteveH_UK
ID: 20417815
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.
0
 
LVL 1

Author Comment

by:JoeDW
ID: 20421542
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?
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 1

Author Comment

by:JoeDW
ID: 20421550
Or is it the client name or company name?
0
 
LVL 19

Accepted Solution

by:
SteveH_UK earned 250 total points
ID: 20421901
When you begin a piece of work for a company, you should establish a specification for that work and agree it.  That piece of work is a contract.  Later, that same company may ask for additional work to be done.  Those jobs are a new contract.

Following that way, you might get something like this:

Company 1 -> Contract 1 : New Corporate Website : Website Solution
Company 1 -> Contract 1 : New Corporate Website : Syndication Web Services (for RSS, etc.)
Company 1 -> Contract 2 : New Intranet : Website Solution
Company 2 -> Contract 1 : MyBrand Website : Website Solution
Company 3 -> Contract 1 : Timesheet software system : WinForms Solution

0
 
LVL 1

Author Closing Comment

by:JoeDW
ID: 31413072
Wonderful, thank you for your help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now