Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi All,

I have some dlls to update in an application, but the application is currently being used by a no. of users. Is there any process to stop the IIS for 1 mins or something like that and update the dlls?

Also there is another problem, if a user is doing a transaction and I stopped the application, there might be some problem. I need to stop the application in such a way that the transaction should not be committed and incomplete data should not enter to the dB.

Is there a proper approach to stop the application for 1 min and update files in IIS?

Thanks a lot in advance.
Posted
Comments
Sergey Alexandrovich Kryukov 24-Aug-15 8:53am    
Is it precompiled or source code?
—SA
F-ES Sitecore 24-Aug-15 9:59am    
If you want to take the site off-line for a short while this might help

http://weblogs.asp.net/scottgu/426755

Assuming the files you want to update are located in the application's bin directory, you can just copy the new files into the directory.

ASP.NET makes a "shadow copy" of the files, and loads them from the copy. When you update the files, it creates a new AppDomain to service any new requests, and signals the previous AppDomain to shut down as soon as it has finished servicing any current requests.

Shadow Copy and your \bin directory[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 24-Aug-15 10:20am    
5ed.
—SA
Just a note: the OS won't allow to remove or modify any module (PE file) currently loaded in memory for execution. So, this is true for assemblies. But the ASP.NET code is typically deployed in the form of source code, which you can update at any time.

—SA
 
Share this answer
 
Comments
Amrut Bishnu 24-Aug-15 9:23am    
Hi Sergey,

Thanks for the answer. But I know that I can update the asp.net dlls at any time. I just wanted to know that is there any way to stop the application then update the dlls and again restart the application,so that the ongoing transactions will not be affected by this.
Sergey Alexandrovich Kryukov 24-Aug-15 9:48am    
I know. No, you generally cannot replace the DLLs, you can only replace source code. You can replace a DLL only when it's not used. If you have some precompiled code, it can be kept from deleting by many repeated HTTP requests which may use it. So, you have to change source code the way this DLL is not used. Let's say, you have two stages: 1) you replace the source code the way your DLL is not used. You could keep the functionality of the old DLL by having it in different name/location; the number of uses of this DLL will be soon exhausted, as user refresh your pages directing them to a different DLL (or none, with temporarily limited functionality); 2) when the DLL can be removed, to it and copy all files as you finally need them.
—SA
Dave Kreskowiak 24-Aug-15 10:09am    
Sorry, but Richard has you beat on this one.
Sergey Alexandrovich Kryukov 24-Aug-15 10:20am    
Nothing to sorry about.
Thank you,
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900