Tuesday, December 20, 2005

Developing as a Non-Admin

I'm finally trying to kick the crutch of developing using an account with admin privileges. That same account was my regular account for day to day use, too. I’ve always known it’s a really, really stupid thing to be doing (see LeBlanc and Howard, Brown, or talk with any long time Unix user who will rightfully heap scorn upon you), but I just went with the path of least resistance.  Hey, I quit a two-pack a day smoking habit.  How hard can it be to kick this admin account thing?

Today I ran into my first small hitch while trying to get finicky NCover working for something I’m writing.  NCover’s very tempermental with its command-line parameters, so you really need to run it from a batch file or NAnt task.  I was trying to get an old NAnt build file working and was running into issues where everything appeared to work nicely, but no coverage report was being generated.  Arrgghhh.

I’d run into this in the past where NCover’s support library CoverLib.dll would lose its mind and require re-registration.  It was so nasty that I just added an exec for registering that library into my NAnt task — it re-registers itself every time the dang coverage runs.

So back to the admin/non-admin issue: regsvr32 will appear to execute just fine to register a DLL if you’re running as a non-admin account, it just doesn’t really do anything.  The DLL wasn’t successfully registered, and I got no feedback that the process failed.

Quick answer?  Use the “runas” to spawn another command window for executing my NAnt task.  This second window was spawned as one of my admin accounts.  Voila!

2 comments:

Anonymous said...

First, congratulations on quitting smoking! :-)

Regarding non-admin, it took me a good week to get in the groove and two to be solid with it. If you haven't found them yet, check out the non-admin wiki (http://nonadmin.editme.com) and AaronMar's weblog (one post in particular: http://blogs.msdn.com/aaron_margosis/archive/2005/04/18/TableOfContents.aspx)

Despite some of the frustrations, I can honestly say that at this point, I wouldn't go back to having admin privs full-time.

Good Luck!

Jim Holmes said...

Thanks very much for the pointers to the two references!

Two more back at you, in case you didn't know about them already:

Keith Brown has a great blog at http://pluralsight.com/blogs/keith/default.aspx, plus there's his entire book as a Wiki: http://www.pluralsight.com/wiki/default.aspx/Keith.GuideBook.HomePage

Subscribe (RSS)

The Leadership Journey