473,385 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

VS.NET Q: where to put common DLLs in a multi project solution, web vs. web application Q

I have learned about compartmentalizing my code base using Class Libraries.
I have my common code such as my ORM framework broken out into their own
Class Libraries, which are referenced as projects from my Website.

I also have a common set of DLLs I use across all of my applications. It
would be great if I could put all of those DLLs into their own projects, and
to reference that project from various solutions.

The way my solution is currently structured, I have a Website wtith several
other projects -- Class Library projects -- that are referenced from that
Website. I am wondering if this is the wrong arrangement for what I describe
in the previous paragraph. I know there is a "website" model, and a "web
application model" in VS.NET 2005.

What I need to know is:
1) What project type I should use to encapsulate my collection of common
DLLs. Should they be contained in their own class library with references to
the required DLLs (versus the Website's "bin" folder?)

2) Do I want to convert to the "Web application model" based on my described
needs.

Thanks. I'll understand this completely soon.

-KF
Jun 22 '07 #1
4 3530
<ke*****@nospam.nospamwrote in message
news:On**************@TK2MSFTNGP05.phx.gbl...
>I have learned about compartmentalizing my code base using Class Libraries.
I have my common code such as my ORM framework broken out into their own
Class Libraries, which are referenced as projects from my Website.

I also have a common set of DLLs I use across all of my applications. It
would be great if I could put all of those DLLs into their own projects,
and to reference that project from various solutions.

The way my solution is currently structured, I have a Website wtith
several other projects -- Class Library projects -- that are referenced
from that Website. I am wondering if this is the wrong arrangement for
what I describe in the previous paragraph. I know there is a "website"
model, and a "web application model" in VS.NET 2005.

What I need to know is:
1) What project type I should use to encapsulate my collection of common
DLLs. Should they be contained in their own class library with references
to the required DLLs (versus the Website's "bin" folder?)

2) Do I want to convert to the "Web application model" based on my
described needs.
My personal feeling is that the Web Site model was a mistake on the part of
Microsoft. I would recommend it as a second line of defense for anyone who
feels that the Web Application model is too complex. I think that it's a
mistake to get people starting with the Web Site model and then to try to
get them to convert to the Web Application model only when the Web Site
model isn't enough.

That's the situation you're in right now. As soon as you start talking about
class libraries as opposed to code files in App_Code, you need the Web
Application model.

Regardless of which Web model you use, I would create a single solution to
contain all of your projects. Place each class library into a single
project, based on how they reference each other. In particular, a set of
classes which reference each other frequently should be in the same project
so they'll be in the same assembly, so they can use the "internal" and
"protected internal" access levels to reference each other's members.

Projects that reference each other can have project references to each
other. That will cause the projects to rebuild as necessary.

Finally, if you go with the Web Application model, the Web Application will
have project references to the projects it needs. When it builds, those
assemblies will be copied into the bin directory of the Web Application.

Things get a little more complicated with multiple solutions, but not much
more. I'd suggest starting with this and changing to multiple solutions when
the single solution becomes a problem.
--
John Saunders [MVP]
Jun 22 '07 #2
Wow, this is the information and synthesis I've been seeking for a long
time, I really appreciate it, John.

I agree with you regarding the problems with the Web Site model. More
generally, I think Microsoft needed/needs to do a much better job explaining
to newbies how professional developers structure a set of projects,
reference class libraries, deploy to virtual directories, and so forth.

The problem now is that a lot of people have walked into VS.NET from a
Dreamweaver/ASP background, rather than a "real developer" background, and
the organizational idiom there is completely different. Some of us from
non-dev backgrounds start out the process of making compiled apps having no
clue of what's being made or how to organize the pieces. With Dreamweaver
et. al, file/project organization tends to be much more literal: on my dev
machine was an archive of a bazillion files that exactly mirrored the
production server. My ASP-based web applications churned out thousands of
files (rendered PDFs and images), and naturally my dev machine served a
backup of what was on production. Simple. This arrangement is easy and works
great for Dreamweaver-ish sites. But it was a disaster when I started
dealing with compiled projects, and cluelessly created one mega solution
based off it. I found it frustrating that my simple projects took minutes to
compile, and that I did not have the seem to have the agility I had when I
wrote Classic ASP apps. I didn't understand why such a great tool with a
great debugger and great Intellisense was so terribly sluggish.

Fortunately for me, .NET-specific tools like EntitySpaces' ORM and Telerik's
components were compelling enough that I stuck with it long enough to figure
out some of how things should be done and to ask the right questions of
helpful people like yourself. I think Microsoft needs to think about the
bazillions of newly minted coders who are going to be coming into VS.NET,
attracted by its amazing IDE, Silverlight Apha's clean programming model
(compared to AS2...), and the ever-increasing capability of the ASP.NET
plafrom. If newbies do not understand the basics of how to structure their
projects and solutions, and they do not have peers to teach them the right
way to do things, many people will not figure out how to make the tool
acceptably performant, or how referenced class libaries as projects can
centralize code smartly, or many other basic, critical things.

One person's $0.02. Stepping off the lonely soapbox, let me thank you again
for your generous help.

-KF
"John Saunders [MVP]" <john.saunders at trizetto.comwrote in message
news:OD**************@TK2MSFTNGP05.phx.gbl...
<ke*****@nospam.nospamwrote in message
news:On**************@TK2MSFTNGP05.phx.gbl...
>>I have learned about compartmentalizing my code base using Class
Libraries. I have my common code such as my ORM framework broken out into
their own Class Libraries, which are referenced as projects from my
Website.

I also have a common set of DLLs I use across all of my applications. It
would be great if I could put all of those DLLs into their own projects,
and to reference that project from various solutions.

The way my solution is currently structured, I have a Website wtith
several other projects -- Class Library projects -- that are referenced
from that Website. I am wondering if this is the wrong arrangement for
what I describe in the previous paragraph. I know there is a "website"
model, and a "web application model" in VS.NET 2005.

What I need to know is:
1) What project type I should use to encapsulate my collection of common
DLLs. Should they be contained in their own class library with references
to the required DLLs (versus the Website's "bin" folder?)

2) Do I want to convert to the "Web application model" based on my
described needs.

My personal feeling is that the Web Site model was a mistake on the part
of Microsoft. I would recommend it as a second line of defense for anyone
who feels that the Web Application model is too complex. I think that it's
a mistake to get people starting with the Web Site model and then to try
to get them to convert to the Web Application model only when the Web Site
model isn't enough.

That's the situation you're in right now. As soon as you start talking
about class libraries as opposed to code files in App_Code, you need the
Web Application model.

Regardless of which Web model you use, I would create a single solution to
contain all of your projects. Place each class library into a single
project, based on how they reference each other. In particular, a set of
classes which reference each other frequently should be in the same
project so they'll be in the same assembly, so they can use the "internal"
and "protected internal" access levels to reference each other's members.

Projects that reference each other can have project references to each
other. That will cause the projects to rebuild as necessary.

Finally, if you go with the Web Application model, the Web Application
will have project references to the projects it needs. When it builds,
those assemblies will be copied into the bin directory of the Web
Application.

Things get a little more complicated with multiple solutions, but not much
more. I'd suggest starting with this and changing to multiple solutions
when the single solution becomes a problem.
--
John Saunders [MVP]


Jun 22 '07 #3
your arrangement is correct.

i would not convert to web application mode (its just a hack), nor does
it improve your problem. all it does is make an additional project file
for the code behind files (which are built into a dll, the ide then has
hide the source files from the aspnet compiler). a separate dll is still
built for each page and the aspnet compiler still builds the site code.

asp.net notion of dll library is the bin folder. all dlls not in the gac
or the framework folder must be copied to the bin folder. vs will this
copy for you if the web site or web application project has a reference
to the dll or class project.

so you will need to add a reference to each dll to the website or web
application in either case.

msbuild supports website solutions, and deployment projects, so you can
do commandline builds of the site and have a deployment folder built. if
you are not using deployment projects, you should.

-- bruce (sqlwork.com)

ke*****@nospam.nospam wrote:
I have learned about compartmentalizing my code base using Class Libraries.
I have my common code such as my ORM framework broken out into their own
Class Libraries, which are referenced as projects from my Website.

I also have a common set of DLLs I use across all of my applications. It
would be great if I could put all of those DLLs into their own projects, and
to reference that project from various solutions.

The way my solution is currently structured, I have a Website wtith several
other projects -- Class Library projects -- that are referenced from that
Website. I am wondering if this is the wrong arrangement for what I describe
in the previous paragraph. I know there is a "website" model, and a "web
application model" in VS.NET 2005.

What I need to know is:
1) What project type I should use to encapsulate my collection of common
DLLs. Should they be contained in their own class library with references to
the required DLLs (versus the Website's "bin" folder?)

2) Do I want to convert to the "Web application model" based on my described
needs.

Thanks. I'll understand this completely soon.

-KF

Jun 23 '07 #4
<ke*****@nospam.nospamwrote in message
news:eT**************@TK2MSFTNGP05.phx.gbl...
Wow, this is the information and synthesis I've been seeking for a long
time, I really appreciate it, John.

I agree with you regarding the problems with the Web Site model. More
generally, I think Microsoft needed/needs to do a much better job
explaining to newbies how professional developers structure a set of
projects, reference class libraries, deploy to virtual directories, and so
forth.

The problem now is that a lot of people have walked into VS.NET from a
Dreamweaver/ASP background, rather than a "real developer" background, and
the organizational idiom there is completely different. Some of us from
non-dev backgrounds start out the process of making compiled apps having
no clue of what's being made or how to organize the pieces. With
Dreamweaver et. al, file/project organization tends to be much more
literal: on my dev machine was an archive of a bazillion files that
exactly mirrored the production server. My ASP-based web applications
churned out thousands of files (rendered PDFs and images), and naturally
my dev machine served a backup of what was on production. Simple. This
arrangement is easy and works great for Dreamweaver-ish sites. But it was
a disaster when I started dealing with compiled projects, and cluelessly
created one mega solution based off it. I found it frustrating that my
simple projects took minutes to compile, and that I did not have the seem
to have the agility I had when I wrote Classic ASP apps. I didn't
understand why such a great tool with a great debugger and great
Intellisense was so terribly sluggish.

Fortunately for me, .NET-specific tools like EntitySpaces' ORM and
Telerik's components were compelling enough that I stuck with it long
enough to figure out some of how things should be done and to ask the
right questions of helpful people like yourself. I think Microsoft needs
to think about the bazillions of newly minted coders who are going to be
coming into VS.NET, attracted by its amazing IDE, Silverlight Apha's clean
programming model (compared to AS2...), and the ever-increasing capability
of the ASP.NET plafrom. If newbies do not understand the basics of how to
structure their projects and solutions, and they do not have peers to
teach them the right way to do things, many people will not figure out how
to make the tool acceptably performant, or how referenced class libaries
as projects can centralize code smartly, or many other basic, critical
things.

One person's $0.02. Stepping off the lonely soapbox, let me thank you
again for your generous help.

-KF

KF, it's good to hear from someone who got here from the other direction.

It seems to me that,with discipline, it should be possible to use the Web
Site model for pure "web site" stuff, and use a "real" development model for
producing the class libraries used by the web site to deal with the
"application" part of what it does. That would allow people used to web site
developemt to continue using their familiar tools and techniques.

The problem comes when trying to wedge non-UI code into the web site model.
It just doesn't work well.

John

>

"John Saunders [MVP]" <john.saunders at trizetto.comwrote in message
news:OD**************@TK2MSFTNGP05.phx.gbl...
><ke*****@nospam.nospamwrote in message
news:On**************@TK2MSFTNGP05.phx.gbl...
>>>I have learned about compartmentalizing my code base using Class
Libraries. I have my common code such as my ORM framework broken out into
their own Class Libraries, which are referenced as projects from my
Website.

I also have a common set of DLLs I use across all of my applications. It
would be great if I could put all of those DLLs into their own projects,
and to reference that project from various solutions.

The way my solution is currently structured, I have a Website wtith
several other projects -- Class Library projects -- that are referenced
from that Website. I am wondering if this is the wrong arrangement for
what I describe in the previous paragraph. I know there is a "website"
model, and a "web application model" in VS.NET 2005.

What I need to know is:
1) What project type I should use to encapsulate my collection of common
DLLs. Should they be contained in their own class library with
references to the required DLLs (versus the Website's "bin" folder?)

2) Do I want to convert to the "Web application model" based on my
described needs.

My personal feeling is that the Web Site model was a mistake on the part
of Microsoft. I would recommend it as a second line of defense for anyone
who feels that the Web Application model is too complex. I think that
it's a mistake to get people starting with the Web Site model and then to
try to get them to convert to the Web Application model only when the Web
Site model isn't enough.

That's the situation you're in right now. As soon as you start talking
about class libraries as opposed to code files in App_Code, you need the
Web Application model.

Regardless of which Web model you use, I would create a single solution
to contain all of your projects. Place each class library into a single
project, based on how they reference each other. In particular, a set of
classes which reference each other frequently should be in the same
project so they'll be in the same assembly, so they can use the
"internal" and "protected internal" access levels to reference each
other's members.

Projects that reference each other can have project references to each
other. That will cause the projects to rebuild as necessary.

Finally, if you go with the Web Application model, the Web Application
will have project references to the projects it needs. When it builds,
those assemblies will be copied into the bin directory of the Web
Application.

Things get a little more complicated with multiple solutions, but not
much more. I'd suggest starting with this and changing to multiple
solutions when the single solution becomes a problem.
--
John Saunders [MVP]



Jun 23 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jon | last post by:
I have 3 VB.net executables that reference the same 3 VB.Net DLLs. How is the best way to distribute the EXEs without putting 3 copies of of DLL on a user's machine. I looked into Private...
2
by: Daric | last post by:
Hi, al I'm using VS2002 to create my web application, by default, VS2002 will build my project in a single dll (myWebApp.dll), but I hope each page correspond to it's own dll (page1.dll, page2.dll),...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
3
by: Jeremy S | last post by:
I wrote an ASP.NET application and pretty much separated out various layers of functionality into individual class files (e.g., dal.cs for all db access). It's currently all in one VS.NET project...
5
by: wrecker | last post by:
Hi all, I have a few common methods that I need to use at different points in my web application. I'm wondering where the best place would be to put these? I think that I have three options. ...
6
by: Vasilis X | last post by:
Hello. Propably a simple question : I have a multi project solution in vb.net. In detail, i have a project "Main" and projects A,B,C. How can I switch between projects ??? Thanks in...
3
by: eduwushu | last post by:
Hi there. Im developing a c# app and i have a solution with some projects: the main project which generates the executable file and some other projects which some of them im compiling generate...
8
by: WebSnozz | last post by:
I have an application written in C that does a lot of low level stuff. It does a lot of things like casting from void*'s. I want to create a new GUI for it in either C# or MC++, but reuse the...
10
by: =?Utf-8?B?UmljaGFyZA==?= | last post by:
Hi, I usually deploy my ASP .NET application to the server by publishing, using Visual Studio 2005 publish feature. This creates the Bin folder on the server, with the compiled DLLs. I've...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.