I want to run some basic checks when my ASP.NET server goes up. Mostly simple things like does the db exist, am i missing any bins, etc. What function do i use to call my code?
+1
A:
I wouldn't waste my time on any of these things. Are they likely to be problems more than once a year or less? Instead, I'd just make sure my code gave good exception messages when or if these problems arise.
John Saunders
2009-06-27 17:35:49
What if he's building an ASP.Net application he wants to sell?
Spencer Ruport
2009-06-27 17:45:49
Then I wouldn't waste my time on these. I'd make sure my installer installed everything; I'd make sure it had a Repair feature; I might separately package the Installation Verification step called in the installer so it could be run as a diagnostic; and I'd make sure to produce excellent exception messages and other diagnostics.
John Saunders
2009-06-27 17:51:18
What if i want to find the problem ASAP instead of eventually ;)
acidzombie24
2009-06-27 18:12:39
Then you could periodically run the Installation Verification Procedure as I suggested. I would be interested to know under what circumstances that ever fails after the first good install. I bet it never does, absent some idiot who deletes the bin directory. You need good runtime exception logging, messages, etc. in any case.
John Saunders
2009-06-27 18:39:16
There is no installer ATM, i am basically passing this around to a few guys (typically w/o source). There is only a few lines added. Exceptions work but then the users would have to do stuff before its thown.
acidzombie24
2009-06-27 20:24:22
I don't think we're understanding each other, and I thought you were talking a production site. Please edit your question to clarify what you're trying to accomplish, what kind of users, how distributed, what version of ASP.NET and Windows, etc.
John Saunders
2009-06-27 20:26:01
A:
I suggest you read ASP.NET Application Life Cycle Overview for IIS 7.0 on MSDN.
Assaf Lavie
2009-06-27 17:44:44