I'm trying to set up a new Windows Forms Application (C++/CLI) in Visual Studio 2010 on Windows 7. Every time I try to open up the Designer, it fails with this unhelpful error:
Exception from HRESULT: 0x8CE00001
Instances of this error (1)
1. Hide Call Stack
at Microsoft.VisualStudio.Designer.Interfaces.IVSMDCodeDomProvider.get_CodeDomProvider()
at Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.CodeDomDocDataAdapter.get_Provider()
at Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.CodeDomDocDataAdapter.get_CompileUnit()
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
If I debug Visual Studio and break on CLR exceptions, it actually throws this exception first:
A first chance exception of type 'System.ArgumentException' occurred in Microsoft.VisualStudio.Design.dll
Additional information: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
With this call stack:
> Microsoft.VisualStudio.Design.dll!Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.VerifyNestedDocDataCompatible() + 0x15d bytes
Microsoft.VisualStudio.Design.dll!Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.Microsoft.VisualStudio.Designer.Interfaces.IVSMDDesignerLoader.Initialize(object pSp, object pHier, int itemid, object punkDocData) + 0xb5 bytes
[Native to Managed Transition]
vcpkg.dll!CVCFormEditorFactory::CreateEditorInstance() + 0x2e49f bytes
msenv.dll!CVsUIShellOpenDocument::OpenSpecificEditor() + 0x784 bytes
VCProject.dll!CVCFileNode::OpenSpecificEditor() + 0xc6 bytes
VCProject.dll!CVCFileNode::OpenSpecificEditor() + 0x3a bytes
VCProject.dll!CVCFileNode::DoOpenFile() + 0x1fe bytes
VCProject.dll!CVCFileNode::DoDefaultAction() + 0x5b bytes
VCProject.dll!CVCArchy::ExecCommand() + 0x8c bytes
msenv.dll!CVsUIHierarchyBaseWin::ExecHierParentChain() + 0x85 bytes
msenv.dll!CVsUIHierarchyBaseWin::WinExecCommand() + 0x7d bytes
msenv.dll!CVsUIHierarchyBaseWin::ProcessLButtonDblClkMsg() + 0xd8 bytes
msenv.dll!FnwpTVFixer() + 0x76b49 bytes
user32.dll!_InternalCallWinProc@20() + 0x23 bytes
user32.dll!_UserCallWinProcCheckWow@32() + 0xb7 bytes
user32.dll!_DispatchMessageWorker@8() + 0xed bytes
user32.dll!_DispatchMessageW@4() + 0xf bytes
msenv.dll!ProcessMessage() + 0x4d bytes
msenv.dll!CMsoCMHandler::EnvironmentMsgLoop() + 0x87 bytes
msenv.dll!CMsoCMHandler::FPushMessageLoop() + 0x79 bytes
msenv.dll!SCM::FPushMessageLoop() + 0x8c bytes
msenv.dll!SCM_MsoCompMgr::FPushMessageLoop() + 0x2a bytes
msenv.dll!CMsoComponent::PushMsgLoop() + 0x28 bytes
msenv.dll!VStudioMainLogged() + 0x22a bytes
msenv.dll!_VStudioMain() + 0x78 bytes
devenv.exe!util_CallVsMain() + 0xdb bytes
devenv.exe!CDevEnvAppId::Run() + 0x693 bytes
devenv.exe!_WinMain@16() + 0x9c bytes
devenv.exe!operator new[]() + 0xb31c bytes
kernel32.dll!@BaseThreadInitThunk@12() + 0x12 bytes
ntdll.dll!___RtlUserThreadStart@8() + 0x27 bytes
ntdll.dll!__RtlUserThreadStart@8() + 0x1b bytes
This is with a clean, new project (File → New → Project... → Visual C++ → CLR → Windows Forms Application). After I create a new project, opening up the autogenerated Form1.h
results in the error instead of the Designer. However, if I create a C# Windows Forms Application instead of C++/CLI, it works fine.
Any ideas on how I can solve this problem and open up the Designer? I've tried all of the following to no avail:
I've found a few similar threads online (one, two, three), but they've all been inconclusive or not worked for me. I've not yet tried fully reinstalling Visual Studio, but I may have to try that next.
After much nuking and reinstalling, I believe this to have been a problem with a Visual Studio Extension.
Completely uninstalling Visual Studio (even with VS2010_Uninstall-RTM.ENU.exe /full /netfx
) and reinstalling it didn't help. But, if I created a new Windows user, it worked fine for that user. Similarly, if I nuked my HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0
and HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0_Config
registry keys (and their subkeys), it worked.
After painstakingly comparing my old registry (where it gave the error) with a fresh registry (where it worked) and reconciling them, the only differences that remained were related to a particular VS extension. Since I no longer need that extension, I don't need its registry keys, so without them, the Designer is working as expected.