I’ve recently rebuilt a development environment – replacing my older Windows 2008 FIM R2 rig with a Windows 2012 MIM and hit an odd problem when trying to trigger the just in time debugger from within my code.
Normally to debug one of my tools, I just set a label at run time and the debugger is automatically triggered using System.Diagnostics.Debugger.Launch(); – however in the new environment the debugger never appears and in the event log I see an error message warning me that “Just-In-Time debugging this exception failed with the following error: The operation attempted is not supported.”
After doing some digging about, it appears that this is actually a security feature introduced after Windows 2008 – fortunately though, it can be turned off by updating the registry and I’ve found that setting HKEY_CLASSES_ROOT\AppID\{E62A7A31-6025-408E-87F6-81AEB0DC9347}\AppIDFlags to a value of 0x08 seems to do the trick and debugging is restored.
more background to why the feature was introduced here: http://stackoverflow.com/questions/11940378/vsjitdebugger-operation-attempted-is-not-supported-on-windows-8-windows-server