.NET Disaster Recovery:
"Safe Computer", Best Practices, and Spyware

By Peter A. Bromberg, Ph.D.

Peter Bromberg  

I've been "fiddling" with Microsoft software since I was a Beta Tester for the Microsoft BASIC COMPILER back in - well, I guess it was sometime around 1985 (Do I look that old? I don't feel old at all). I guess I just started getting interested in computers early. Most kids were driving 409's with Hurst shifters, but I was at home pulling apart my CB set with a soldering iron so I could soup it up with an illegal 40 Watt power tube. In the end, it really didn't matter, 'cause girls still liked me, even though I only drove a crappy old VW with a CB Set, a nine foot whip antenna, and a battery converter that sounded like your Dad's old electric shaver . Bless their hearts, did we have fun!

Aside from some minor frustrations over the years, I would have to say that I have no problem with Microsoft as a company, or working with Microsoft products. "Microsoft bashing" has become popular especially with propagandists and politicians, but most of the Microsoft employees I've gotten to know over the years are dedicated, energetic people who are really interested in producing and supporting quality software. As Don Box put it so eloquently at a recent Professional Developer Conference, "For $2500 a year, they give me the WORKS". And that's true -- for the price of a MSDN Universal subscription, they not only give you about $70,000 worth of software to use to your heart's content, but they do a pretty damn good job of supporting you as a developer as well.



The problem is, there are a lot of enemies out there that Microsoft can't protect you from. One of the biggest enemies is -- you guessed it -- YOURSELF! We as developers are a strange breed. It doesn't seem to matter what the README says, we usually don't bother to read it (At least, not BEFORE installing anything!). We are always fiddling and experimenting. If the word BETA appears anywhere, we are the first to want to get our hands on it. And, unfortunately, unless certain precautions are taken, that's a recipe for a lot of BLUE SCREENS. Sound familiar? Ha! I thought so. Read on!

So I thought that I'd take a few minutes to share some of the painful lessons I've learned, as well as to encourage others who have more knowledge to post to our Eggheadcafe.com discussion forums with information that they've learned.

PROTECT THE REGISTRY

I use Windows 2000 Advanced Server at my "home office" for most of my development work. I need this so I can run certain versions of software such as SQL Server Enterprise and other things that I am exposed to in my "day job", and for private development work that I do for clients in my "off hours". One of the most important things I've learned is to back up the registry at regular intervals. You do this by using "Programs/Accessories/System Tools/Backup", choosing "Emergency Repair Disk" and checking the "Also Backup the Registry to the Repair Directory" option. Throw a floppy in the drive, click, and within a few seconds you are done. The Repair disk is certainly useful (especially if you have a fresh set of four startup disks, right?) but to me, having a complete fresh copy of my registry every few days is much more valuable, and I'll tell you why.

HAVE A METHOD TO GAIN NTFS FILESYSTEM ACCESS WITHOUT THE OS.

I simply can't stress this enough! If your system bombs, 99% of the time if you can restore a recent full copy of the Registry, you will be just fine. There are a number of ways to do this. You can install the Recovery Console, which basically gives you "DOS BOX" access to the NTFS filesytem, or you can use a commercial product such at NTFSDOS from Sysinternals (Dave Solomon and Mark Russinovitch) at http://www.sysinternals.com/, or you can do what I do: with hard drives so cheap these days, I've got 2 HDs in my development box. The primary has my OS that I described above. The second one has Windows XP Pro. If my primary OS bombs because of my incessant fiddling, I can simply boot into the other OS, COPY the registry files from the REPAIR folder right over the bad registry, boot back into the primary, and I am "Home free". In a worst case scenario, I might have to reinstall Norton or some new program I've just installed, but the bottom line is, I've only lost about 10 minutes of my precious time. I'd much rather advise a new developer to spend $70 on a second hard drive to do this, than on a bunch of useless "Fixit" software.

RESTORING IIS AND ASP.NET

Another thing you want to get in the habit of doing regularly (especially if you are a web developer) is to back up the IIS metabase. If you don't know how to do this, shame on you! GO LEARN RIGHT NOW. If you ever have to uninstall IIS and reinstall it because it won't start, you can restore all your configuration settings and applications by simply restoring the Metabase. Think of this as the "Registry" for everything in IIS.

Another area you'll run into is that your .NET aspx etc. files won't work anymore. This is because the ISAPI mapping for .NET got bombed. Here's how to restore it, right out of the KB article from Microsoft:

SUMMARY
After you install the .NET Framework SDK or Visual Studio .NET, Internet Information Server (IIS) mappings are created to associate new file extensions and settings for ASP.NET. If you did not have IIS installed when you ran the SDK or Visual Studio Setup, or you uninstalled and reinstalled IIS after you ran the SDK or Visual Studio Setup, those settings will not be in place and you will experience unexpected behavior when you attempt to view ASP.NET pages. (Don't you just LOVE those little gems --"unexpected behavior" -- yeah, like the sucker tries to DOWNLOAD the file instead of serving it)

MORE INFORMATION
There are two different ways to fix IIS mappings for ASP.NET. (I can't believe this generosity - they're giving us TWO ways to fix what's busted!)

To repair IIS mappings for ASP.NET, you can run the Aspnet_regiis.exe utility by following the steps below.

Click Start, and then click Run. Type cmd and click OK.
At the command prompt, type "\WINNT\Microsoft.NET\Framework\v1.0.2914\aspnet_regiis.exe" -i and click OK.

To repair IIS mappings for ASP.NET you must register Aspnet_isapi.dll. To do so:
Click Start and then click Run.
Type regsvr32 -i <Windows folder>\Microsoft.NET\Framework\v1.0.2914\aspnet_isapi.dll and then click OK.

Regsvr32 will return the results of the registration.

GET RID OF SPYWARE!

Now this is a little pet peeve of mine. We live in a world where people get bright ideas and start up businesses and operations that basically act as "leeches". They install software without our knowledge or consent. This software connects out to the Internet, using up valuable resources and bandwidth, and basically sucks up our browsing habits and other information (it can get pretty bad, but I won't go into more details) and then they basically SELL THIS INFORMATION FOR PROFIT. These people are SCUM. They are the lowest of the low, akin to the terrorists we are waging war against today. There are so many programs that install SPYWARE that it will make your head spin. If you want to see what programs do this, go here immediately. If you want to GET RID OF THE SPYWARE, GET THIS.. Get rid of the SPYWARE and tell the deliverers of this utter CRAP that you REFUSE to use their software until they remove the offending baggage that installs silently with it!

Hope these items are of use to you!

 

Peter Bromberg is an independent consultant specializing in distributed .NET solutionsa Senior Programmer /Analyst at in Orlando and a co-developer of the NullSkull.com developer website. He can be reached at info@eggheadcafe.com