how to redeploy .net app without iisreset

A

Andy Fish

Hi,

when I want to upgrade my asp.net web app on the deployment server, my
process is basically this:

1. stop the web site in iis manager
2. in explorer, rename the web root directory from, say, 'foo' to 'foo.old'
3. make a new directory called 'foo'
4. install the new software
5. apply any config changes
6. restart the web site.

Occasionally this process seems to work OK, but most of the time I cannot
perform step 2 without doing an iisreset to unload the DLLs - I get the
standard message about files being locked. This is rather a PITA because
there are several web sites on the same machine and I don't really want to
interrupt the others.

Is there any more forceful way of stopping one web site such that the
asp.net DLLs get unloaded without resoriting to stopping the whole of IIS?

TIA

Andy
 
T

Tampa.NET Koder

You are doing things the old way. In asp.net you don't have to start and
stop your web server to redeploy your app. Copy all your file up to the
server (including the .dll if you have one) then asp.net will shut down your
old process and spin off a new process.

What you are doing is exactly what asp.net tried to solve.
 
K

Ken Cox [Microsoft MVP]

Hi Andy,

Like you, we found that we had to stop the Web site before uploading a new
version. Although in *theory* it shouldn't be necessary, we ended up with
locked DLLs.

I wonder if there's a way to just change the Web.config of the site you're
uploading? That would cause a reset of that application but not force a stop
of the whole of IIS. You would need to make sure nobody hits the site after
the web.config change and before the new files are copied - otherwise you'd
have the same mess you have now.

Yes, it is a PITA.

Ken
Microsoft MVP [ASP.NET]
 
A

Andy Fish

OK, I did some more experiments using sysinternals process explorer.

Although it doesn't lock the DLLs, it seems to lock the parent directory
(I'm guessing that putting a filesystem watch on a directory locks the
parent directory).

This is why (as the previous reply pointed out) it's posible to simply copy
the new version over the old, even though it's not possible to delete or
rename the old one.

I found that if I edited the web.config file it would remove most of the
locks and then I could rename the web root directory.

In my case, the directory I wanted to rename was one level higher (I have a
structure like /myApp/web/bin where web is the web root). but I found that
after renaming the web directory and waiting a few seconds I could then
rename /myApp directory.

Andy

Ken Cox said:
Hi Andy,

Like you, we found that we had to stop the Web site before uploading a new
version. Although in *theory* it shouldn't be necessary, we ended up with
locked DLLs.

I wonder if there's a way to just change the Web.config of the site you're
uploading? That would cause a reset of that application but not force a
stop of the whole of IIS. You would need to make sure nobody hits the site
after the web.config change and before the new files are copied -
otherwise you'd have the same mess you have now.

Yes, it is a PITA.

Ken
Microsoft MVP [ASP.NET]

Andy Fish said:
Hi,

when I want to upgrade my asp.net web app on the deployment server, my
process is basically this:

1. stop the web site in iis manager
2. in explorer, rename the web root directory from, say, 'foo' to
'foo.old'
3. make a new directory called 'foo'
4. install the new software
5. apply any config changes
6. restart the web site.

Occasionally this process seems to work OK, but most of the time I cannot
perform step 2 without doing an iisreset to unload the DLLs - I get the
standard message about files being locked. This is rather a PITA because
there are several web sites on the same machine and I don't really want
to interrupt the others.

Is there any more forceful way of stopping one web site such that the
asp.net DLLs get unloaded without resoriting to stopping the whole of
IIS?

TIA

Andy
 
P

Patrice

As a result you could copy the current directory to an old one and install
"in place".

IMO the problem is that ASP.NET was designed for "in place" deployment (ie
overwriting the current app) while you actually install in a new
directory...

Patrice


--

Andy Fish said:
OK, I did some more experiments using sysinternals process explorer.

Although it doesn't lock the DLLs, it seems to lock the parent directory
(I'm guessing that putting a filesystem watch on a directory locks the
parent directory).

This is why (as the previous reply pointed out) it's posible to simply copy
the new version over the old, even though it's not possible to delete or
rename the old one.

I found that if I edited the web.config file it would remove most of the
locks and then I could rename the web root directory.

In my case, the directory I wanted to rename was one level higher (I have a
structure like /myApp/web/bin where web is the web root). but I found that
after renaming the web directory and waiting a few seconds I could then
rename /myApp directory.

Andy

Ken Cox said:
Hi Andy,

Like you, we found that we had to stop the Web site before uploading a new
version. Although in *theory* it shouldn't be necessary, we ended up with
locked DLLs.

I wonder if there's a way to just change the Web.config of the site you're
uploading? That would cause a reset of that application but not force a
stop of the whole of IIS. You would need to make sure nobody hits the site
after the web.config change and before the new files are copied -
otherwise you'd have the same mess you have now.

Yes, it is a PITA.

Ken
Microsoft MVP [ASP.NET]

Andy Fish said:
Hi,

when I want to upgrade my asp.net web app on the deployment server, my
process is basically this:

1. stop the web site in iis manager
2. in explorer, rename the web root directory from, say, 'foo' to
'foo.old'
3. make a new directory called 'foo'
4. install the new software
5. apply any config changes
6. restart the web site.

Occasionally this process seems to work OK, but most of the time I cannot
perform step 2 without doing an iisreset to unload the DLLs - I get the
standard message about files being locked. This is rather a PITA because
there are several web sites on the same machine and I don't really want
to interrupt the others.

Is there any more forceful way of stopping one web site such that the
asp.net DLLs get unloaded without resoriting to stopping the whole of
IIS?

TIA

Andy
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top