rehab for asp.net in production
Posted by jonathan - 20/02/08 at 07:02:06 amCompared to my buddies, Noam and Jason, I have always embodied the old webmaster job title the more them. This means I tend to work the box administration and configuration as much as the code. As I release my day-time code to beta, once again I am revisiting deployment control measures.
Question 1 - Do you manipulate, muck up, mess with the machine config?
I have been burnt by the GAC before <future post/> so I tend to deploy my apps with everything they need right in the bin and app folders. This means I a bit less tidiness, having have extra dlls in my bin and that I make most tweaks in my app web.config but has the benefit of easy deployment. Deployment is not the time you want to be messing with settings!
A recent post I came across from ScottGu’s blog linked to this article, Top 10 Best Practices for Production asp net Applications. I have read similarly titled articles in the past so I went here on a lark, expecting to find nothing new, but I was pleasantly surprised. The number one new tidbit was, “Set retail=’true’ in your machine.config”. Never heard of that before, but if true it does a hat trick:
This will kill three birds with one stone. It will force the ‘debug’ flag in the web.config to be false, it will disable page output tracing, and it will force the custom error page to be shown to remote users rather than the actual exception or error message. For more information you can read Scott Guthrie’s post or the MSDN reference.
I have to test it out, but I wish I had known about it years ago when I worked in a shop with very loose deployment controls. Developers were constantly leaving crumbs on my freshly vacuumed carpet, page level trace=”true” statements. Once tested I’ll then have to figure out how to role out machine.config changes to a web farm since my current company is freakishly spendthrift with the servers.
Question 2 - Do you deploy source code?
In a compiled language such as java or c#, do you deploy source code? My only real working knowledge is in c# so I’ll stick to that domain for now. This question arises as I have some java guys on the team who want to push .cs files to the server to have the “ability to patch code”. For me this smells like a glade plug-in, the scent while nauseating is really covering up the stank of bad source control management.
Fortunately google comes to the rescue as a search for for “deploying source code” gave me this first read from a relatively good source, aspnetresources.
The whitepaper also lists JIT compilation, but I won’t go there. It’s a questionable approach which is outside of the scope of this article. Please, refer to Chapter 4 of the whitepaper, “Deployment Issues for .NET Applications”, to read more about NGEN and JIT compilation.
The white paper mentioned is this, Deploying .NET Framework-based Applications at Patterns & Practices, which is a better source, but the paper is a bit dated being published in 2003. After a quick read that did not really give me anything useful.
After changing search terms, “deploying .cs files”. The first thread, mentions publishing .cs files, but not a single person says they do it. They mostly hawk the web deployment project and/or the web application project, which is of course what I’m already selling.
Dr. Peter A. Bromberg, creator of eggheadcafe says, “I wouldn’t even consider deploying .cs files”. - eggheadcafe
Having read the esteemed Dr Bromberg a few times over the years, that quote is good enough for me, but I am still searching for the article that explains the pros of deploying source. Let me know if you find it and make sure it is a reputable source too.
To top it off here’s my favorite qoute from Jason, invoking a bit of Amy Whinehouse,
“NO NO NO… when you ‘patch’ you create and unpredictable hybrid release that isn’t really anything.”
No Comments yet »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Powered by WordPress with GimpStyle Theme design by Horacio Bella.
Entries and comments feeds.
Valid XHTML and CSS.