GAC Question

T

Tiraman

Hi ,

i have the A.dll in my GAC (only one occurrence)
and after i deleted it from the GAC i saw that it still working .
so i did IISRESET and now it throw an error .

can we define the time out that the dll stay in the memory ?

lets say that if no one access the dll for 60 sec it will be removed from
the memory and only in the next time
that some one request this page it will reload it to the memory .


Best Regards ,

Tiraman :)
 
P

Peter Huang

Hi Tireman,

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to control when an
assembly from GAC will be unloaded from the memory.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

Now I am research the issue, I will update you with new information ASAP.


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang

Hi Tiraman,

I think in .NET we can unload an assembly, if we wants to do so, we have to
unload the appdomain which loads the assembly. Usually when an ASP.NET
application is running, it is running under an appdomain in the
aspnet_wp.exe and the necessary assebmlies will be loaded into the
appdomain , but if an Assembly is in GAC, it will be loaded into an
special appdomain(shared appdomain) which is indepent of the appdomain of
the asp.net application for performance and share concern.

So if an assembly is in the GAC, I think we can not force it to unload from
the memory, since we can not force the special appdomain to restart because
it will impact all the webapplication in the aspnet_wp.exe process. There
is an idleTimeout attribute of the processModel in the machine.config can
used to specifies the period of inactivity, in hr:min:sec string format,
after which ASP.NET automatically ends the worker process.(aspnet_wp.exe),
but this will impact the whole aspnet_wp.exe process, which cause the other
webapplication to be restarted. It will cause heavy performance hit so I do
not recommend you use the option.

I wonder why you need to control when the assembly will be unloaded from
the memory. Do you wants to implement the dynamically update? If so, I
think we'd better use the bindingRedirect in the web.config file. Since we
maintain the version of the assembly in GAC by changing its version if we
have made any updated.

Also in IIS6, we can run a webapplication at a indepent Application Pool,
so that if we recycle one webapplication by restart the worker process, it
will just restart this Application Pool. In this way, we will need arrange
all the webapplication will use the updated shared assembly in GAC to run
in the same application pool so that we do not need to create many
Application Pools.

The last method I think we will need to set back to deploy the shared
assembly in each bin folder of the web application, so everytime we change
the Web.config file, the Global.asax file, or any files in the Bin folder
will cause the appdomain which hosts the webapplication to restart. Also in
this way we have to make additional efforts to deploy the assembly into
multiple bin folders. But we can do by using a Batch file.


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
T

Tiraman

Hello Peter ,

for your question about controlling the assembly load/unload from memory ,
it's bcz i looked a way which my aspx files will be able to work in front of
new assembly version (which are in the GAC)
without doing any change in the aspx and now it is working gr8 10x to u :)

I m using the web/machine.config in order to implement the redirect version
for assembly files which solve my problem :)
so i don't need to do work around like restarting the aspnet process or
using time out for reloading the assembly .

10x again :)

And Have a nice day !

Tiraman ;-)
 

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

Similar Threads


Top