Thursday 22 September 2011

Gotcha: Editing tests in Visual Studio 2008 is unresponsive

If you have an issue where by Visual Studio 2008 appears unresponsive during editing the code in a unit test, this could be down to “CMI” = “Code Model Inspection” which involves catching all (yes, *all*) events from the code editing window.  These events are put onto a queue which is polled periodically and then the Test View / Test List Editor is brought up to date.  The default time for this polling is 1.5 sec, but it can be configured from the registry. 

The registry hacks below set this polling interval to one day.  Since I’ve done this, I can edit tests just as smoothly as any other code.

On x86 machines

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\EnterpriseTools\QualityTools]
"CMUnitTestDelay"=dword:05265c00
"EnableCMI"=dword:00000000

For x64 machines

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\EnterpriseTools\QualityTools]
"CMUnitTestDelay"=dword:05265c00
"EnableCMI"=dword:00000000

No comments:

Post a Comment

How to find the last interactive logons in Windows using PowerShell

Use the following powershell script to find the last users to login to a box since a given date, in this case the 21st April 2022 at 12pm un...