Proper Way to Create Visual Studio Projects
11 June 2008
I keep forgetting how to create a Visual Studio solution just the way I like it. If you have the same
problem, bookmark this page and return here every time you need to start a new solution.
This is where I want my Visual Studio files:
C:/Projects/CentriBumPupWF/CentriBumPup.sln
C:/Projects/CentriBumPupWF/CentriBumWeb/CentriBumWeb.proj
C:/Projects/CentriBumPupWF/CentriBumWeb/Default.aspx
C:/Projects/CentriBumPupWF/CentriBumLogic/CentriBumLogic.proj
So basically, I want my solution in the root directory and then all the projects in seperate directories underneath.
With Visual Studio's focus on Rapid Application Development for the Lowest Common Denominator, you would think that one
thing that would be simple would be starting a new project. Starting a website from scratch is not something one
actually does very often, but its always an exciting moment. Finally, after months stuck on some complex, overdue mess, you can
finally throw yourself into that new one that's going to make everyone millionaires.
If you are lucky enough to have stumbled on this post (it should be on about page 20 of Google), I will show you how to create
a new project so that it looks like the structure above (a highly recommended
structure, by the way).
The process is surprisingly straightforward and you will wonder why I bother writing a whole article about it, but I just found
that took me about 5 shots to get it right, and something which is usually as simple as File->New should not require so
many vibrations of my brain cells.
So this is how you do it:
- STEP ONE: Open a fresh copy of Visual Studio.
- STEP TWO: File->New->New Project
- STEP THREE: Choose project type
- STEP FOUR: Name = CentriBumPupWeb,
Location=C:/Projects/
Solution=CentriBumPup
(notice that I don't name the web project and the solution the same - this is a silly idea, even though VS tries to do it for
you)
Check "Create a directory for solution"
- STEP FIVE: I like to suffix my solution folder with "WF", just so that I know its a working folder under Subversion.
Using FreeCommander or your other
Windows Explorer alternative, I can jump out and rename it to C:/Projects/CentriBumPupWF/
- STEP SIX: Now to add a new project to the solution, I use File->Add->New Project