Search This Blog

Friday, January 28, 2011

"The RPC server is unavailable" problem demoting a domain controller in an NT domain

When using HyperV for an enterprise development task I needed to rapidly create, promote, and then demote servers. The promotions went fine but I ran into problems doing the demotions -- I kept running into a problem where I got the message claiming that "The RPC server is unavailable." The error message claimed that it couldn't contact another DC in the domain to complete AD replication before it did the demotion, which seemed unlikely since DNS was set up correctly.

I don't know why this solution worked, but ... the way to get this fixed was to go to another DC in the devdomain, bring up the "Active Directory Sites and Servers" admin tool, select the server I was trying to demote, expand the "NTDS" child icon, then right-click on it to get the "Replicate Now" context menu option.

I clicked on that to force a replication then tried the demotion opration again. This time it worked.

Thursday, January 6, 2011

"CLR has been unable to transition from COM context for 60 seconds" error in Visual Studio

This is an error in VS2008 I've gotten infrequently that appears when running a really long process (in my case, a recursive treewalk of a very large Active Directory structure) in the Visual Studio Debugger.

The title of the messagebox is ""ContextSwitchDeadlock was detected" and the text reads like: "The CLR has been unable to transition from COM context 0x12345 to COM context 0x54321 for 60 seconds ..."

The code is not the problem, it's the debugger being helpful when it thinks there's a runaway process.

The answer is to change some settings in the debugger to stop Visual Studio from halting on long processes: "Debug", then "Exceptions", then "Managed Debug Assistants". Uncheck the box for "ContextSwitchDeadlock."

One note -- this is not a system-wide settings change, it seems to be in the project's .suo file and specific to the project you're debugging.