Shared Dll

M

mimi

I have created a component (called DataAccess) using com+ service for
retrieving data from database. When I reference it to other projects, I
notice that it is copied in to the bin folder of each project. And after
all the projects run, under component service/computer/mycomputer/com+
applications, I see DataAccess app, and under it, there are several
DataAccess components running, I assume 1 component for each project. How
can I reference all the projects to only one dll and to have one instance of
it running (don't know if it's better than several instance ?). For
example, I like to have my web structure like
C:
- inetpub
--sharedDll //the shared dll should be in this folder
--wwwroot
--project1
--project2
--project3

thanks
 
P

Patrick Steele [MVP]

I have created a component (called DataAccess) using com+ service for
retrieving data from database.

So this is a strong-named assembly and you've installed it into the
Global Assembly Cache (gac)?
When I reference it to other projects, I
notice that it is copied in to the bin folder of each project. And after
all the projects run, under component service/computer/mycomputer/com+
applications, I see DataAccess app, and under it, there are several
DataAccess components running, I assume 1 component for each project.
Probably.

How can I reference all the projects to only one dll and to have one instance of
it running (don't know if it's better than several instance ?).

Well, if your assembly is in the GAC, you're only using one DLL. And if
you only want one instance running, that's a design decision (it's
called a "singleton" design pattern). If you haven't designed it to
only have one copy running, you'll have some redesign work to do.

There's no harm in having more than one running. That's one of the
benefits of COM+. It will handle the object instantiation for you and
will reuse an existing object if it's not being used by anyone (saves
time since the object doesn't have to be instantiated).
 
M

mimi

Thanks Patrick,

it is strong name assembly, but I didn't install it into GAC. How to
install it into GAC?.
 
P

Patrick Steele [MVP]

Thanks Patrick,

it is strong name assembly, but I didn't install it into GAC. How to
install it into GAC?.

You can either use the .NET Framework utility (Start, Programs,
Administrative Tools, .NET Framework Configuration) or go to a VS.NET
2003 command prompt and enter:

gacutil /i <dllname>.dll
 
M

mimi

but it doesn't solve the problem that it copies the dll into each
application bin folder
 
T

Trevor Benedict R

You can right click on the Library Name under the References, choose
Properties and set the copy Local Property to False.

HTH

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top