J
John Brock
I'm using Visual Basic 2008 Express, and I've been wondering about
the "proper" way to structure my code. In particular, I'm not
clear on the purpose of "solutions". I understand that they are
a container for "projects", but what isn't clear is when you should
put everything in a single solution, and when you should have
separate solutions.
One thing I have noticed is that it is possible for one solution
to include a project that was initially created as part of another
solution. For example, I can create a solution S1 with a project
P1, which is a class library and creates a DLL. I can then create
another solution S2, add P1 to S2 (which does *not* result in P1
being physically copied to S2), and then create another project P2
in S2 that references P1. At least in this simple case I don't
run into any problems: I can open either S1 or S2 to edit P1, and
when I run P2 the P1 DLL gets compiled and copied to the proper P2
bin directory.
What this means is that if I have two applications which both
reference a single DLL, I have the option of creating a single
solution and putting all three projects there, or creating three
separate solutions, one for each project, and adding the DLL project
to the two application solutions. My intuition tells me that the
former is probably the "right" way to go, but I would have a hard
time saying why. In particular, with the second approach my two
applications are isolated from each other, and I don't have to
worry about the "Multiple Startup Projects" thing. So can anyone
explain what advantages the first approach has, or would problems
I might have if I went with the second?
(Also, can anyone recommend a good general article on the best ways
to structure .NET projects and solutions?)
the "proper" way to structure my code. In particular, I'm not
clear on the purpose of "solutions". I understand that they are
a container for "projects", but what isn't clear is when you should
put everything in a single solution, and when you should have
separate solutions.
One thing I have noticed is that it is possible for one solution
to include a project that was initially created as part of another
solution. For example, I can create a solution S1 with a project
P1, which is a class library and creates a DLL. I can then create
another solution S2, add P1 to S2 (which does *not* result in P1
being physically copied to S2), and then create another project P2
in S2 that references P1. At least in this simple case I don't
run into any problems: I can open either S1 or S2 to edit P1, and
when I run P2 the P1 DLL gets compiled and copied to the proper P2
bin directory.
What this means is that if I have two applications which both
reference a single DLL, I have the option of creating a single
solution and putting all three projects there, or creating three
separate solutions, one for each project, and adding the DLL project
to the two application solutions. My intuition tells me that the
former is probably the "right" way to go, but I would have a hard
time saying why. In particular, with the second approach my two
applications are isolated from each other, and I don't have to
worry about the "Multiple Startup Projects" thing. So can anyone
explain what advantages the first approach has, or would problems
I might have if I went with the second?
(Also, can anyone recommend a good general article on the best ways
to structure .NET projects and solutions?)