Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Publishing to IIS - Best Practices

Tags:

iis

publish

I'm not new to web publishing, BUT I am new to publishing against a web site that is frequently used. Previously, the apps on this server were not hit very often, but we're rolling out a high demand application. So, what is the best practice for publishing to a live web server?

  1. Is it best to wait until the middle of the night when people won't be on it (Yes, I can pretty much rely on that -- it's an intranet and therefore will have times of non-use)
  2. Publish when new updates are made to the trunk (dependent on build success of course)
  3. If 2 is true, then that seems bad if someone is using that specific page or DLL and it gets overwritten.

...I'm sure there are lots of great places for this kind of thing, but I didn't use the right google search terms.

like image 916
Nick DeVore Avatar asked Nov 05 '22 23:11

Nick DeVore


1 Answers

@Nick DeVore wrote:

If 2 is true, then that seems bad if someone is using that specific page or DLL and it gets overwritten.

It's not really an issue if you're using ASP.NET stack (Webforms, MVC or rolling your own) because all your aspx files get compiled and therefore not touched by webserver. /bin/ folder is completely shadowed somewhere else, so libraries inside are not used by webserver either.

IIS will wait until all requests are done (however there is some timeout though) and then will proceed with compilation (if needed) and restart of AppDomain. If only a few files have changed, there won't even be AppDomain restart. IIS will load new assemblies (or compiled aspx/asmx/ascx files) into existing AppDomain.

@Nick DeVore wrote:

Help me understand this a little bit more. Point me to the place where this is explained from Microsoft. Thanks!

Try google for "IIS AppDomain" keywords. I found What ASP.NET Programmers Should Know About Application Domains.

like image 137
lubos hasko Avatar answered Nov 14 '22 21:11

lubos hasko