winforms - Visual Studio 2010 设计器运行时出错

标签 winforms visual-studio-2010 user-controls designer

我正在使用 VS2010,如果我在设计器模式下打开一个表单并运行我的应用程序,设计器选项卡将不再显示表单设计器,而是会显示错误(并且只能通过重新启动 IDE 来修复)说:

"To prevent possible data loss before loading the designer, the following errors must be resolved:"

1 Error:

"The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: ##### --- The base class ##### could not be loaded. Ensure the assembly has been referenced and that all projects have been built"

然后我显示以下调用堆栈:

at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)

非常感谢任何帮助,这真的很烦人。

谢谢

乔尔。

最佳答案

我偶尔也会遇到这个 Visual Studio 错误,并且我深深地忽略了错误文本,而是执行以下操作:

  1. 关闭“设计”选项卡
  2. 通过双击“解决方案资源管理器”或右键单击“源代码”选项卡并选择“ View 设计器”来重新打开设计模式
  3. 突然间一切又恢复正常了!

如果没有帮助,您可能需要将第 2 条更改为: 关闭并重新启动 Visual Studio。

也许这可以帮助你。

关于winforms - Visual Studio 2010 设计器运行时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5036889/

相关文章:

c# - TinyMCE 类似于 C# .NET 的富文本编辑器?

c# - 如果我在其 Load 事件中打开 OpenFileDialog,Windows Forms 窗体将在后台打开

c# - 对齐按钮内的中间文本字符串

C# Windows 窗体用户控件控件设计器支持

c# - 如何根据wpf toolbartray的可用空间调整宽度

c# - Windows 窗体 : closing, 但未关闭

c# - MSB0001 : Internal MSBuild Error: refCount should not be less than 1

c# - 从 XML 文件中提取内容

c# - Visual Studio 无法检测到现有对象,即使是在同一文件中也是如此。项目仍在 build 中

c# - 关于 C# 中的 string.Intern