Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/322.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Visual studio Windows窗体设计器错误:“框架内容的构造失败。”_C#_Visual Studio_Windows Forms Designer - Fatal编程技术网

C# Visual studio Windows窗体设计器错误:“框架内容的构造失败。”

C# Visual studio Windows窗体设计器错误:“框架内容的构造失败。”,c#,visual-studio,windows-forms-designer,C#,Visual Studio,Windows Forms Designer,在我将UserControl添加到表单后,它突然开始产生以下错误: 调用COM组件时返回错误HRESULT E_FAIL 所以我搜索了一下,发现它和缓存有某种联系。所以我从我的解决方案中删除了suo文件。现在它产生了这个错误: 来自HRESULT的未指定错误异常:0x80004005 E_失败 我也在谷歌上搜索了一下,发现我应该阅读ActivityLog.xml的内容,它可以在%appdata%\Microsoft\VisualStudio中找到。它以以下消息开头: 框架内容的构造失败 我再也找

在我将UserControl添加到表单后,它突然开始产生以下错误:

调用COM组件时返回错误HRESULT E_FAIL

所以我搜索了一下,发现它和缓存有某种联系。所以我从我的解决方案中删除了suo文件。现在它产生了这个错误:

来自HRESULT的未指定错误异常:0x80004005 E_失败

我也在谷歌上搜索了一下,发现我应该阅读ActivityLog.xml的内容,它可以在%appdata%\Microsoft\VisualStudio中找到。它以以下消息开头:

框架内容的构造失败

我再也找不到任何解决办法了

以下是该日志中的完整错误:

框架内容的构造失败。帧标识符: ST:0:0:{31fc2115-5126-4a87-b2f7-77eaab65048b}帧标题:异常 详细信息:System.ArgumentNullException:参数名称:protocolHandler 在 Microsoft.XamlDiagnostics.UI.LivePropertyExplorer.Model.PropertyExplorerModel..ctorIProtocolHandler protocolHandler、IActiveElementTracker、ITelemetryLogger 遥测记录器 Microsoft.XamlDiagnostics.Model.XamlDiagnosticsTool.GetPropertyExplorerModelServiceProvider 服务提供商位于 Microsoft.XamlDiagnostics.Model.XamlDiagnosticsTool.CreatePropertyExplorerIServiceProvider serviceProvider,ResourceDictionary主题词典,UIElement searchContentControl位于 Microsoft.VisualStudio.ClientDiagnostics.XamlDiagnostics.PropertyExplorerToolWindow.GetContent 在 Microsoft.VisualStudio.ClientDiagnostics.XamlDiagnostics.XamlDiagnosticsToolWindowBase.ShowContent 在 Microsoft.VisualStudio.ClientDiagnostics.XamlDiagnostics.XamlDiagnosticsToolWindowBase.Initialize 在 Microsoft.VisualStudio.Shell.WindowPane.InternalSetSiteIServiceProvider p at Microsoft.VisualStudio.Shell.WindowPane.Microsoft.VisualStudio.Shell.Interop.IVsWindowPane.SetSiteIServiceProvider psp at Microsoft.VisualStudio.Shell.WindowPane.Microsoft.VisualStudio.Shell.Interop.IVsUIElementPane.SetUIElementSiteIServiceProvider p at Microsoft.VisualStudio.Platform.WindowManagement.UIElementDocumentObject.SetSiteDocumentObjectSite 地点在 Microsoft.VisualStudio.Platform.WindowManagement.DocumentObjectSite.InitializeDocumentObject对象 蓬克维 Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.CreateContentPaneFrameMoniker frameMoniker,布尔isDocument,字符串lpstrMkDoc,UInt32 eCreateWindowFlags、对象punkView、对象punkData、IServiceProvider pServiceProvider,IVSUI层次结构pUIHierarchy,UInt32 vsid,Guid rguidCmdUI、视图组父级、IVsWindowFrame和ppWindowFrame位于 Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.CreateContentPaneString pszName、Int32 fDockViewOn、Int32 fDocument、字符串lpstrMkDoc、UInt32 eCreateWindowFlags,UInt32 dwToolWinId,对象punkView,对象 punkData、IServiceProvider pServiceProvider、IVsUIHierarchy pUIHierarchy、UInt32 vsid、Int32和pfDefaultPosition、Guid和rguidCmdUI、, IVsWindowFrame和ppWindowFrame位于 System.Runtime.InteropServices.Marshal.ThroweException for hr内部32 错误代码,IntPtr errorInfo位于 Microsoft.VisualStudio.Shell.Package.CreateToolWindowType toolWindowType、Int32 id、UInt32标志位于 Microsoft.VisualStudio.Shell.Package.CreateToolWindowType toolWindowType,Int32 id,提供ToolWindowAttribute工具,位于 Microsoft.VisualStudio.Shell.Package.FindToolWindowType toolWindowType,Int32 id,布尔创建,ProvideToolWindowAttribute 位于Microsoft.VisualStudio.Shell.Package.CreateToolWindowGuid的工具& toolWindowType,Int32 id位于 Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVSToolWindows Factory.CreateToolWindowGuid& toolWindowType,UInt32 id位于 Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent


发生什么事了?框架内容构建失败意味着什么?

多亏了Caius,我才找到了问题所在。由于有关UserControl的错误,设计器无法呈现表单。我查看了designer.cs文件,发现一条警告,指出[path]中的UserControl[version]和[path]中的UserControl之间存在冲突

我查看了该项目的参考资料,在那里找到了一个自我参考资料!所以我删除了它,错误就消失了


UserControl和表单在同一个项目中,在将UserControl添加到表单时,我将UserControl从工具箱拖放到表单上。因此,它自动为我的项目添加了一个自引用。我不知道它为什么那样做。但是删除引用解决了这个问题。

可能是设计人员试图绘制用户控件的呈现,并且在执行此操作时遇到了来自控件的错误so@CaiusJard你是对的,我刚刚注意到一条警告,说usercontrol和完全相同的我们之间存在冲突 电子控制