473,386 Members | 1,801 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,386 software developers and data experts.

Global Assembly Cache

I took over a legacy e-commerce project that utilized.NET 1.1 to create the
website code and all associated assemblies. This code is used to power
around 75 web sites on a single web server. Right now they have a separate
directory for each store, complete with a \bin folder that contains about 20
DLL files. The \bin folder is replicated for each store, so we have about 70
copies (I'll explain the missing 5 in a second) of the same \bin directory
sitting around. When it comes time to make a change in the code, it's a
pain.

Here are my questions:

1) Can I simply drop these DLL files in the GAC (I'm aware of the
requirements for registering an assembly in the GAC) and then delete the
corresponding DLL files in the \bin folder for each site?

2) There are 5 or 6 sites that have had customizations performed to the
code. I do NOT want these few sites to load the assembly from the GAC,
rather I want them to continue to load the DLL in it's \bin folder. Can I
override the GAC files by simply keeping the custom DLL in the sites \bin
folder? If not, what's the recommended approach?

Remember, this is all .NET 1.1. :)

Thanks!

Scott

Nov 10 '08 #1
7 5648
2) There are 5 or 6 sites that have had customizations performed to the
code. I do NOT want these few sites to load the assembly from the GAC,
rather I want them to continue to load the DLL in it's \bin folder. Can I
override the GAC files by simply keeping the custom DLL in the sites \bin
folder? If not, what's the recommended approach?
I'm 100% certain, but I believe that the application will first look
in the app folder for the assembly before looking in the GAC. In any
case, you can install both versions of the assembly in the GAC and
then in the web.config file (or machine.config) you can redirect the
app to the correct version in the GAC.

Something like this:

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="assemblyName" culture=""
publicKeyToken="25283151a234958d"/>
<bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/
>
</dependentAssembly>
</assemblyBinding>
</runtime>

Chris
Nov 10 '08 #2
"Scott Stark" <em***@scottstark.comwrote in message
news:eU**************@TK2MSFTNGP05.phx.gbl...
1) Can I simply drop these DLL files in the GAC (I'm aware of the
requirements for registering an assembly in the GAC) and then delete the
corresponding DLL files in the \bin folder for each site?
Yes.
Since you mention that you are already aware of the requirements, I
will not mention that the DLLs need to have a Strong Name :)
2) There are 5 or 6 sites that have had customizations performed to the
code. I do NOT want these few sites to load the assembly from the GAC,
rather I want them to continue to load the DLL in it's \bin folder. Can I
override the GAC files by simply keeping the custom DLL in the sites \bin
folder? If not, what's the recommended approach?
Remember, this is all .NET 1.1. :)
It's not that simple -- the GAC will take priority. The easiest approach
is to assign a different version number (using the
[assembly:AssemblyVersion(...)] attribute) to the customized DLLs. Each web
site will load the same version of the DLL with which it was compiled,
regardless of wether that version sits on the GAC or the bin folder.
Nov 10 '08 #3
Hi Chris,

Thanks for the response.

I assume both versions of the DLL use the same strong name, they just differ
in their version numbers, correct? So 1.0.0.0 is my core DLL file and
2.0.0.0 is for Custom Store A, 3.0.0.0 is for Custom Store B, etc?

Then I'd update the web.config file as you suggested for the custom stores?
Do I need a redirect for version 1.0.0.0 on all the other stores (which one
does it use by default)? The only other question I have is how to generate
the code for web.config (publickeytoken, etc). Where does all that info come
from?

Sorry for the basic questions, haven't had much opportunity to deal with
this stuff before.

Thanks,

Scott

"Chris Dunaway" <du******@gmail.comwrote in message
news:c9**********************************@w1g2000p rk.googlegroups.com...
>2) There are 5 or 6 sites that have had customizations performed to the
code. I do NOT want these few sites to load the assembly from the GAC,
rather I want them to continue to load the DLL in it's \bin folder. Can I
override the GAC files by simply keeping the custom DLL in the sites \bin
folder? If not, what's the recommended approach?

I'm 100% certain, but I believe that the application will first look
in the app folder for the assembly before looking in the GAC. In any
case, you can install both versions of the assembly in the GAC and
then in the web.config file (or machine.config) you can redirect the
app to the correct version in the GAC.

Something like this:

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="assemblyName" culture=""
publicKeyToken="25283151a234958d"/>
<bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/
>>
</dependentAssembly>
</assemblyBinding>
</runtime>

Chris
Nov 10 '08 #4
Thank you! Between you and Chris, I think I've got my answers.

"Alberto Poblacion" <ea******************************@poblacion.orgwro te
in message news:Ox****************@TK2MSFTNGP03.phx.gbl...
"Scott Stark" <em***@scottstark.comwrote in message
news:eU**************@TK2MSFTNGP05.phx.gbl...
>1) Can I simply drop these DLL files in the GAC (I'm aware of the
requirements for registering an assembly in the GAC) and then delete the
corresponding DLL files in the \bin folder for each site?

Yes.
Since you mention that you are already aware of the requirements, I
will not mention that the DLLs need to have a Strong Name :)
>2) There are 5 or 6 sites that have had customizations performed to the
code. I do NOT want these few sites to load the assembly from the GAC,
rather I want them to continue to load the DLL in it's \bin folder. Can I
override the GAC files by simply keeping the custom DLL in the sites \bin
folder? If not, what's the recommended approach?
Remember, this is all .NET 1.1. :)

It's not that simple -- the GAC will take priority. The easiest
approach is to assign a different version number (using the
[assembly:AssemblyVersion(...)] attribute) to the customized DLLs. Each
web site will load the same version of the DLL with which it was compiled,
regardless of wether that version sits on the GAC or the bin folder.

Nov 10 '08 #5
"Scott Stark" <em***@scottstark.comwrote in message
news:e0**************@TK2MSFTNGP03.phx.gbl...
I assume both versions of the DLL use the same strong name, they just
differ in their version numbers, correct?
You mean the same *key*. The version number is part of the Strong Name.

Then I'd update the web.config file as you suggested for the custom
stores? Do I need a redirect for version 1.0.0.0 on all the other stores
(which one does it use by default)? The only other question I have is how
to generate the code for web.config (publickeytoken, etc). Where does all
that info come from?
If you are using the Framework 1.1 you don't need to worry about
entering the assembly versions in web.config. Just Add a Reference to the
DLL you want to use, and build the project. The version number of the
Referenced DLL will be built into the main DLL that contains the code of
your website, so it will know which version to call.

Also, in your specific case, you don't want to redirect any DLLs to a
different version. This is precisely what you are trying to *avoid*, that
is, you want each site to use its own DLL (the one with which it was
compiled) instead of being redirected to a different version.
On the other hand, you could compile all sites with the same DLL, and
then add a Redirect in web.config to force a site to use a different version
at runtime.

Nov 10 '08 #6
Hi Alberto,

Thanks for the explanations. In this case, I'm not referencing an assembly
within the project. It's the main website assembly (the one that contains
all the code-behind files from my ASPX pages) that I want in the GAC.

"Alberto Poblacion" <ea******************************@poblacion.orgwro te
in message news:u0*************@TK2MSFTNGP03.phx.gbl...
"Scott Stark" <em***@scottstark.comwrote in message
news:e0**************@TK2MSFTNGP03.phx.gbl...
>I assume both versions of the DLL use the same strong name, they just
differ in their version numbers, correct?

You mean the same *key*. The version number is part of the Strong Name.

>Then I'd update the web.config file as you suggested for the custom
stores? Do I need a redirect for version 1.0.0.0 on all the other stores
(which one does it use by default)? The only other question I have is how
to generate the code for web.config (publickeytoken, etc). Where does all
that info come from?

If you are using the Framework 1.1 you don't need to worry about
entering the assembly versions in web.config. Just Add a Reference to the
DLL you want to use, and build the project. The version number of the
Referenced DLL will be built into the main DLL that contains the code of
your website, so it will know which version to call.

Also, in your specific case, you don't want to redirect any DLLs to a
different version. This is precisely what you are trying to *avoid*, that
is, you want each site to use its own DLL (the one with which it was
compiled) instead of being redirected to a different version.
On the other hand, you could compile all sites with the same DLL, and
then add a Redirect in web.config to force a site to use a different
version at runtime.
Nov 10 '08 #7
"Scott Stark" <em***@scottstark.comwrote in message
news:ug**************@TK2MSFTNGP04.phx.gbl...
Thanks for the explanations. In this case, I'm not referencing an assembly
within the project. It's the main website assembly (the one that contains
all the code-behind files from my ASPX pages) that I want in the GAC.
Ah. That's very different from what I had in mind. I'm not even sure
that this will work if you place it in the GAC. You will have to experiment
a little bit.

Nov 10 '08 #8

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

Similar topics

3
by: DDE | last post by:
Hi everybody, I developed an assembly common to all my Web Services, so I registered it and put it in the Global Assembly Cache. Now, I modified this assembly, but cannot succed to have this new...
7
by: JerryW | last post by:
I just reinstalled .NET 2003 (after repeated attempts to get ASP.NET Web Applications to work). I first did a complete uninstall of .NET 2003, .NET Framework 1.1, and IIS. I also completely deleted...
11
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some...
2
by: George Durzi | last post by:
I have a dll that I use in several projects, that I placed in the Global Assembly Cache. This dll is references in each of my projects. This Dll is referenced by a type= declaration in my...
41
by: Miguel Dias Moura | last post by:
Hello, I am working on an ASP.NET / VB page and I created a variable "query": Sub Page_Load(sender As Object, e As System.EventArgs) Dim query as String = String.Empty ... query =...
1
by: Ray | last post by:
Dear all, Now, I am using Global Assembly Cache to share assembly between server and clients. However, it seems that the server and clients use individual Global Assembly Cache. For example, the...
6
by: Terrance | last post by:
I currently experimenting with VB.net 2005 express edition. I was wondering if anyone knows how to deploy an assembly to the global assembly cache using the express edition? I tried using the...
2
by: rrossney | last post by:
Please look at the "what I've already done" section of this message before responding to it: I believe that I've done everything that the people who experience this error are typically told to do....
1
by: Mythran | last post by:
We don't use the Microsoft Windows Installer 2.0 for our setup packages. Instead, we use InnoSetup which is much easier to use and learn and more flexible (that I have found). The only part that...
6
by: Piotrekk | last post by:
Hi In my solution I have two projects. First is Library project. The second project uses this library ( dll ). I am registering this assembly in global assembly cache ( by .net configuration...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...

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.