Although I touched on this in my credential provider article (http://msdn.microsoft.com/msdnmag/issues/07/01/CredentialProviders/default.aspx) for MSDN Mag, I could have done a better job of describing how to get out of a certain nasty debugging situation. Specifically, what do you do when you’ve got a broken credprov registered on the system, and it’s preventing you from logging on?
First answer: reboot to safe mode. Logon as the local admin via password. Un-register the broken credprov. Reboot.
To make your life even easier, ensure that your credprov has working DllRegisterServer and DllUnregisterServer exports, and that those are the first thing you test. That way, once you’re in safe mode, all you have to do is "regsvr32.exe /u mycredprov.dll".
Off the top of my head, I can’t think of a good reason why the above shouldn’t work, but you never know. In general, when testing plug-ins that can hose a system (e.g. credprovs), we always do either of the following:
– Test on a VM (best practice), and take a snapshot before installing the credprov. Undoing a mistake in this case takes less time than a reboot on most machines.
– Otherwise, if a separate test machine is the only option, keep a safe-boot partition (i.e. a separate working boot entry, perhaps XP)