Application Domain and Hot Deployment

J

Jack Wright

Dear All,
Every Virtual directory under IIS is executed in a new AppDomain.
This is done by CLR itself. When I deploy a dll under its bin, the
AppDomain is restarted as a result all my dlls under the bin again go
for compilation.
Is there anyway to avoid this? Can I create a AppDomain
programatically, that will avoid this error? Will putting the dll in
GAC solve the problem?
How do I avoid AppDomain restarts under IIS due to hot deployment?
Also if my application access any function of a dll, then it does not
get copied into the bin folder (message stating that the dll is in use
is displayed). How do I overcome these? Please help...

Thanks & Regards
Jack
 
S

Scott Allen

Hi Jack:

The way to avoid "the file is in use" msg is to take advantage of the
shadow copy feature in asp.net. Assemblies in the bin directory are
copied to a temp directory before being loaded into the process and
avoid being locked. Nothing from outside the bin directory is shadow
copied.

The only way to avoid the restart would be to manage your own app
domain. Once an appdomain loads a dll there is no unloading - the
whole appdomain has to come down. If you google.com for [.net plugin
architecture] you'll find some examples.

Is the recompile causing a big problem?
 
J

Jack Wright

Is the recompile causing a big problem?
Yes. Users experience speed problems when a deployment is done. How to
overcome this problem. Why does it go for recompiling all the dlls?
Plugin archietecture
I guess this is basically for dlls that are put in a directory other
than the bin (that are found using the probing path). Am I right?

Will putting the dll in GAC solve the problem?

Please help...

TALIA
Many Regards
Jack
 
S

Scott Allen

Even with the GAC you'd have to shut down the application to upgrade,
and the app would recompile the next time it started.

You might google for "ASPX precompile" and see if there are any tools
to help. It is probably the ASPX compiling and JITing that is chewing
up time.
 
J

Jack Wright

But even if I deploy a class dll why does all ASPX pages go recompile...
Also has MS defined a strategy for "Hot Deployment"
Please help...

TALIA
Many Regards
Jack
 
S

Scott Allen

The Hot Deployment option from MS has always been to xcopy files to
the server and let the ASP.NET runtime start a new appdomain if need
be. Since ASPX pages cannot be "pre-compiled" in 1.x, they will always
compile when the application restarts. I suppose

I suppose MS realizes this presents a problem for many people because
in 2.0 you can precompile ASPX pages too. Do you have batch compile
setup in the web.config?
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top