我正在使用 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 错误,并且我深深地忽略了错误文本,而是执行以下操作:
- 关闭“设计”选项卡
- 通过双击“解决方案资源管理器”或右键单击“源代码”选项卡并选择“ View 设计器”来重新打开设计模式
- 突然间一切又恢复正常了!
如果没有帮助,您可能需要将第 2 条更改为: 关闭并重新启动 Visual Studio。
也许这可以帮助你。
关于winforms - Visual Studio 2010 设计器运行时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5036889/