Worked on second case in a row where Visual Studio was hanging when we click on Design View.It would take 45-60 second to respond.
First thing was to check if VS 2008 SP-1 was installed because they were couple issue related to Design view slow performance which were fixed in SP-1.We were already at SP-1 level.Next thing noticed was Visual studio hangs only with one particular big project and it woks fine with new web projects.

Common thing to check in slow response/performance cases is was look into in task manager and see whether it is because of CPU spike or high memory.Checking task manger we noticed devenv.exe was spiking CPU between 85-90% when we try to switch to Design View.

Decided to capture three set of  manual memory dump with help of Debug Diag  during CPU spike activity.

!runaway in all the dumps were showing some activity is going on Thread 0.

We were trying to load/resolve dll to populate form toolbox on Design view

0:000> !clrstack
ESP EIP
0012e21c 7c82860c [ComPlusMethodFrameGeneric: 0012e21c] Microsoft.VisualStudio.Design.Toolbox.ProjectAutoToolboxManager+UnmanagedMetaDataEngine+IMetaDataImport.ResolveTypeRef(Int32, System.Guid ByRef, IMetaDataImport ByRef)
0012e234 47e8f980 Microsoft.VisualStudio.Design.Toolbox.ProjectAutoToolboxManager+UnmanagedMetaDataEngine.ResolveTypeRef(IMetaDataImport ByRef, Int32 ByRef, System.Guid)
0012e284 47e8f67e Microsoft.VisualStudio.Design.Toolbox.ProjectAutoToolboxManager+UnmanagedMetaDataEngine.ImplementsInterface(IMetaDataImport, Int32, System.Type, System.Collections.IDictionary)
0012e2f0 47e908dd Microsoft.VisualStudio.Design.Toolbox.ProjectAutoToolboxManager+UnmanagedMetaDataEngine.GetToolboxTypes(System.String)
0012e3ac 47e84bbb Microsoft.VisualStudio.Design.Toolbox.ProjectAutoToolboxManager.UpdateToolboxItems(Boolean, Boolean, Boolean)
0012e468 47e84a5e Microsoft.VisualStudio.Design.Toolbox.ProjectAutoToolboxManager.EnvDTE._dispBuildEvents.OnBuildDone(EnvDTE.vsBuildScope, EnvDTE.vsBuildAction)
0012e8cc 79e71b4c [HelperMethodFrame_1OBJ: 0012e8cc] System.RuntimeMethodHandle._InvokeMethodFast(System.Object, System.Object[], System.SignatureStruct ByRef, System.Reflection.MethodAttributes, System.RuntimeTypeHandle)
0012e93c 792d5348 System.RuntimeMethodHandle.InvokeMethodFast(System.Object, System.Object[], System.Signature, System.Reflection.MethodAttributes, System.RuntimeTypeHandle)
0012e98c 792d50f6 System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, Boolean)
0012e9c8 792d4fde System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)

 

0:000> kL
ChildEBP RetAddr 
0012c080 79ebf75f mscorwks!PEDecoder::CheckCorHeader+0xb7
0012c09c 79ed297b mscorwks!PEDecoder::CheckFormat+0x53
0012c0d8 79ed29d0 mscorwks!PEImageLayout::Map+0x108
0012c10c 79ed182f mscorwks!PEImage::GetLayoutInternal+0xd5
0012c150 79ec1615 mscorwks!PEImage::GetLayout+0x8a
0012c1ec 79ec14bf mscorwks!RuntimeOpenImageInternal+0x103
0012c234 79ec07ea mscorwks!GetAssemblyMDInternalImportEx+0x9d
0012c24c 79ec22af mscorwks!CreateMetaDataImport+0x16
0012c26c 79ec232f mscorwks!CAssemblyManifestImport::Init+0x35
0012c294 79fa3aee mscorwks!CreateAssemblyManifestImport+0x53
0012c93c 79fa425f mscorwks!CAsmDownloadMgr::CreateAssembly+0x12d
0012cc78 79fa3f11 mscorwks!CAsmDownloadMgr::DoSetupRFS+0xa5
0012cefc 79fa3cf2 mscorwks!CAsmDownloadMgr::DoSetup+0x24e
0012cf48 79fa0ce0 mscorwks!CAssemblyDownload::DoSetup+0x7b
0012cf7c 79fa0e2f mscorwks!CAssemblyDownload::DownloadComplete+0xb6
0012d1d8 79fa0e88 mscorwks!CAssemblyDownload::KickOffDownload+0x1cf
0012d240 79eb8b0d mscorwks!CAssemblyName::BindToObject+0x568
0012d2b8 79f1e4d8 mscorwks!FusionBind::RemoteLoad+0x14d
0012d340 79eb8e5e mscorwks!FusionBind::LoadAssembly+0x223
0012d5ec 7a2f2f3e mscorwks!AssemblySpec::FindAssemblyFile+0xdc

 

0:000> .frame 06
06 0012c234 79ec07ea mscorwks!GetAssemblyMDInternalImportEx

0:000> dv
     szFileName = 0x0012cfc0
           riid = 0x79f4d1f8 {ee62470b-e94b-424e-9b7c-2f00c9249f93}
          flags = MDInternalImport_Default (0)
         ppIUnk = 0x0012c268
        hModule = 0x79e9dd92
   dwFileLength = 0x12c238

 

0:000> du 0x0012cfc0
0012cfc0  "D:\Utilities\log\Assemblies\2.0\release\abc.dll"

 

Top guess was to try setting auto populate property for Form designer to false so that it does not try to load control automatically.

Under Tools->Options -> Windows Forms designer –> AutoToolboxPopulate=false.

Well that seem to have made significant difference.

Later on that control was removed from the project to get permanent relief.

Till then  Hot