cusimar9
cusimar9

Reputation: 5259

Deploying a precompiled update for .NET web application?

We have a number of web applications in .NET 4.0 (written using Visual Studio 2010) which are precompiled and deployed onto the production servers.

Currently when we do an update we replace all the existing files with the updated binaries. This updates the application but it also restarts the application so all users have to log back in again.

The deployed binaries basically consist of a single .dll for every project in my solution.

Is there any way the web application can be updated without interrupting any existing users?

I realise one way to do this would be to deploy the source file and have them be compiled by the webserver on the fly but this is not really a viable option for us.

Upvotes: 1

Views: 233

Answers (1)

Hans Passant
Hans Passant

Reputation: 941218

This is supported in the CLR with the AppDomainSetup.ShadowCopyFiles property. When turned on, the CLR makes a copy of an assembly before loading it. So only the copy is locked and the original can be overwritten. This feature is explicitly designed for ASP.NET, a CLR host that recycles AppDomains easily. There is an excellent MSDN article about it that shows how you configure it.

Upvotes: 6

Related Questions