Connecting Tech Pros Worldwide Help | Site Map

How to share a set of classes from two IIS web sites?

Quentin Huo
Guest
 
Posts: n/a
#1: Nov 18 '05
Hi:

I have two web sites in my IIS. I want them to share or use one set of
classes that I created, because they have same functions that the classses
provide. And maybe in the future I will create more web sites to use the set
of classes. But I don't know how to do this. Where do I need to put the set
of classes? Do I have to make them be DLLs?

Thanks

Q.


John M Deal
Guest
 
Posts: n/a
#2: Nov 18 '05

re: How to share a set of classes from two IIS web sites?


If you want to share the physical assemblies as opposed to sharing the
data that they contain you could simply install them into the GAC. This
way you'd only have to deploy the assemblies once and reference them
from each project. Hope that helps.

Have A Better One!

John M Deal, MCP
Necessity Software

Quentin Huo wrote:[color=blue]
> Hi:
>
> I have two web sites in my IIS. I want them to share or use one set of
> classes that I created, because they have same functions that the classses
> provide. And maybe in the future I will create more web sites to use the set
> of classes. But I don't know how to do this. Where do I need to put the set
> of classes? Do I have to make them be DLLs?
>
> Thanks
>
> Q.
>
>[/color]
Quentin Huo
Guest
 
Posts: n/a
#3: Nov 18 '05

re: How to share a set of classes from two IIS web sites?


Hi,

Thank you very much!

I am a novice on .net. Can you tell me what the GAC is? And if possible, can
you introduce me some websites or materials that talking about how to do it?

Thanks

Q.

"John M Deal" <johndeal@necessitysoftware.com> wrote in message
news:eW6jIaL0EHA.2016@TK2MSFTNGP15.phx.gbl...[color=blue]
> If you want to share the physical assemblies as opposed to sharing the
> data that they contain you could simply install them into the GAC. This
> way you'd only have to deploy the assemblies once and reference them from
> each project. Hope that helps.
>
> Have A Better One!
>
> John M Deal, MCP
> Necessity Software
>
> Quentin Huo wrote:[color=green]
>> Hi:
>>
>> I have two web sites in my IIS. I want them to share or use one set of
>> classes that I created, because they have same functions that the
>> classses provide. And maybe in the future I will create more web sites to
>> use the set of classes. But I don't know how to do this. Where do I need
>> to put the set of classes? Do I have to make them be DLLs?
>>
>> Thanks
>>
>> Q.[/color][/color]


John M Deal
Guest
 
Posts: n/a
#4: Nov 18 '05

re: How to share a set of classes from two IIS web sites?


The GAC is the Global Assembly Cache. It's primary purpose is to provide
a shared location where assemblies can be stored for reference by
multiple applications. For example the assemblies that contain the core
classes of .Net (like System, System.Data, ...) are stored there. I
don't know of any "good" references but Microsoft has a number of decent
articles that can point you in the right direction and there are plenty
of articles online for this. The two things I'd recommend searching for
are "Global Assembly Cache" and "Strong Name" (the latter is necessary
for the former).

Here's a couple of links you can get started with:

http://support.microsoft.com/kb/815808
http://www.microsoft.com/resources/d...emblycache.asp
http://msdn.microsoft.com/library/de...emblycache.asp

Have A Better One!

John M Deal, MCP
Necessity Software

Quentin Huo wrote:[color=blue]
> Hi,
>
> Thank you very much!
>
> I am a novice on .net. Can you tell me what the GAC is? And if possible, can
> you introduce me some websites or materials that talking about how to do it?
>
> Thanks
>
> Q.
>
> "John M Deal" <johndeal@necessitysoftware.com> wrote in message
> news:eW6jIaL0EHA.2016@TK2MSFTNGP15.phx.gbl...
>[color=green]
>>If you want to share the physical assemblies as opposed to sharing the
>>data that they contain you could simply install them into the GAC. This
>>way you'd only have to deploy the assemblies once and reference them from
>>each project. Hope that helps.
>>
>>Have A Better One!
>>
>>John M Deal, MCP
>>Necessity Software
>>
>>Quentin Huo wrote:
>>[color=darkred]
>>>Hi:
>>>
>>>I have two web sites in my IIS. I want them to share or use one set of
>>>classes that I created, because they have same functions that the
>>>classses provide. And maybe in the future I will create more web sites to
>>>use the set of classes. But I don't know how to do this. Where do I need
>>>to put the set of classes? Do I have to make them be DLLs?
>>>
>>>Thanks
>>>
>>>Q.[/color][/color]
>
>
>[/color]
bruce barker
Guest
 
Posts: n/a
#5: Nov 18 '05

re: How to share a set of classes from two IIS web sites?


the best way is build dll(s), and add a reference to them in the second
project. VS will then copy them to the local bin. avoid installing them in
the GAC as this is not the best practice (as it make support/updates more
difficult, and leads back to dll hell). you can also make a seperate project
out of the dll and share the project between web apps (this is source code
sharing).

-- brice (sqlwork.com)



"Quentin Huo" <q.huo@manyworlds.com> wrote in message
news:u3xYlUL0EHA.3972@TK2MSFTNGP12.phx.gbl...
| Hi:
|
| I have two web sites in my IIS. I want them to share or use one set of
| classes that I created, because they have same functions that the
classses
| provide. And maybe in the future I will create more web sites to use the
set
| of classes. But I don't know how to do this. Where do I need to put the
set
| of classes? Do I have to make them be DLLs?
|
| Thanks
|
| Q.
|
|


Closed Thread


Similar ASP.NET bytes