473,779 Members | 2,001 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

I have learned about compartmentaliz ing 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 3571
<ke*****@nospam .nospamwrote in message
news:On******** ******@TK2MSFTN GP05.phx.gbl...
>I have learned about compartmentaliz ing 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.saunder s at trizetto.comwro te in message
news:OD******** ******@TK2MSFTN GP05.phx.gbl...
<ke*****@nospam .nospamwrote in message
news:On******** ******@TK2MSFTN GP05.phx.gbl...
>>I have learned about compartmentaliz ing 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 compartmentaliz ing 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******** ******@TK2MSFTN GP05.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
"applicatio n" 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.saunder s at trizetto.comwro te in message
news:OD******** ******@TK2MSFTN GP05.phx.gbl...
><ke*****@nospa m.nospamwrote in message
news:On******* *******@TK2MSFT NGP05.phx.gbl.. .
>>>I have learned about compartmentaliz ing 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
7751
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 assemblies and the Global Assembly but I am having a hard time figuring them out. Ideally, I would like to have one install that puts all 3 EXEs and all 3 DLLs on the workstation. Any recommendations would be appreciated. Jonathan
2
1351
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), how can I build a ASP.net project in multi DLLs? Should I build each .cs file alone in command line? that's unimaginable in a large project Any comment is every appreciated Daric
0
3227
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 converted/developed with VB.NET. What I want from debugging is to be able to step into the methods in the DLLs called from ASP scripts using Visual Studio .NET. Background: For typical script debugging issues, you can read and follow the two documents on...
3
1467
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 and gets compiled into one dll. I want to re-use some of the classes in other projects - so what all do I need to do to get these classes into their own dll? I presume that they will go into their own VS.NET project - but I've held off on doing...
5
3199
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. 1. I can create a common module like common.vb in my project and put all the functions in there. 2. Create a utility class and create the common functions as shared
6
1986
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 advance, Vasilis
3
1585
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 dll's which my main project needs to run. When i compile a dll project it generates the dll it implements. Then i take that dll and put it in the directoory where my main app executable is. Then i go to my main project and add a reference in it to...
8
2207
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 existing code. The options I've considered so far: 1. Create a new MC++ GUI project and add the *.c files to them and mark them with pragma unamanged. However, the /clr option does not compile *.c files, so I rename them to *.cpp, and now they...
10
1930
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 been asked to publish by copying the files manually instead. I stopped IIS for the application, deleted the application files and subfolders from the server, copied the files and folders from my local PC's project,
0
9632
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10302
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10136
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10071
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9925
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8958
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5501
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.