Visual studio Windows Form designer error: "Construction of frame content failed."

0

After I added a UserControl to my Form it suddenly started to produce this error:

Error HRESULT E_FAIL has been returned from a call to a COM component

So I googled around and found out it is somehow related to cache. So I deleted suo file from my solution. And now it produces this error:

Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

I googled that too and found out I should read the contents of the ActivityLog.xml which can be found in %appdata%\Microsoft\VisualStudio. It starts with this message:

Construction of frame content failed.

I couldn't find any solution any further.

here is the complete error from that log:

Construction of frame content failed. Frame identifier: ST:0:0:{31fc2115-5126-4a87-b2f7-77eaab65048b} Frame caption: Exception details: System.ArgumentNullException: Parameter name: protocolHandler at Microsoft.XamlDiagnostics.UI.LivePropertyExplorer.Model.PropertyExplorerModel..ctor(IProtocolHandler protocolHandler, IActiveElementTracker tracker, ITelemetryLogger telemetryLogger) at Microsoft.XamlDiagnostics.Model.XamlDiagnosticsTool.GetPropertyExplorerModel(IServiceProvider serviceProvider) at Microsoft.XamlDiagnostics.Model.XamlDiagnosticsTool.CreatePropertyExplorer(IServiceProvider serviceProvider, ResourceDictionary themeDictionary, UIElement searchContentControl) at Microsoft.VisualStudio.ClientDiagnostics.XamlDiagnostics.PropertyExplorerToolWindow.GetContent() at Microsoft.VisualStudio.ClientDiagnostics.XamlDiagnostics.XamlDiagnosticsToolWindowBase.ShowContent() at Microsoft.VisualStudio.ClientDiagnostics.XamlDiagnostics.XamlDiagnosticsToolWindowBase.Initialize() at Microsoft.VisualStudio.Shell.WindowPane.InternalSetSite(IServiceProvider p) at Microsoft.VisualStudio.Shell.WindowPane.Microsoft.VisualStudio.Shell.Interop.IVsWindowPane.SetSite(IServiceProvider psp) at Microsoft.VisualStudio.Shell.WindowPane.Microsoft.VisualStudio.Shell.Interop.IVsUIElementPane.SetUIElementSite(IServiceProvider p) at Microsoft.VisualStudio.Platform.WindowManagement.UIElementDocumentObject.SetSite(DocumentObjectSite site) at Microsoft.VisualStudio.Platform.WindowManagement.DocumentObjectSite.InitializeDocumentObject(Object punkView) at Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.CreateContentPane(FrameMoniker frameMoniker, Boolean isDocument, String lpstrMkDoc, UInt32 eCreateWindowFlags, Object punkView, Object punkData, IServiceProvider pServiceProvider, IVsUIHierarchy pUIHierarchy, UInt32 vsid, Guid rguidCmdUI, ViewGroup parent, IVsWindowFrame& ppWindowFrame) at Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.CreateContentPane(String pszName, Int32 fDockViewOn, Int32 fDocument, String lpstrMkDoc, UInt32 eCreateWindowFlags, UInt32 dwToolWinId, Object punkView, Object punkData, IServiceProvider pServiceProvider, IVsUIHierarchy pUIHierarchy, UInt32 vsid, Int32& pfDefaultPosition, Guid& rguidCmdUI, IVsWindowFrame& ppWindowFrame) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, UInt32 flags) at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, ProvideToolWindowAttribute tool) at Microsoft.VisualStudio.Shell.Package.FindToolWindow(Type toolWindowType, Int32 id, Boolean create, ProvideToolWindowAttribute tool) at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Guid& toolWindowType, Int32 id) at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsToolWindowFactory.CreateToolWindow(Guid& toolWindowType, UInt32 id) at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()

What's going on? What does Construction of frame content failed mean?

c#
visual-studio
windows-forms-designer
asked on Stack Overflow Oct 15, 2018 by Bizhan

1 Answer

0

Thanks to Caius I managed to find the problem. The designer was unable to render the Form because of an error regarding the UserControl. I looked into the designer.cs file and find a warning saying that there is a conflict between UserControl [version] in [path] and UserControl in [path].

I looked into the references of the project and found a self-reference there! So I removed it and the error went away.

The UserControl and Form were in the same project and while adding the UserControl to the Form I drag-and-dropped the UserControl from the Toolbox onto the Form. So it automatically added a self-reference to my project. I'm not sure why it did that. But removing the reference solved the issue.

answered on Stack Overflow Oct 15, 2018 by Bizhan • edited Oct 15, 2018 by Bizhan

User contributions licensed under CC BY-SA 3.0