sharpdevel未能加载设计器

本文关键字:加载 sharpdevel | 更新日期: 2023-09-27 18:19:59

我正在将Sharpdevel 5.1.0.5134.NET 4.5.51209一起使用使桌面应用程序基于Windows.Forms

起初,一切都很好,没有任何警告,设计师正确地显示了表单,我可以轻松地添加组件。

之后,我从包管理控制台正确添加了OxyPlot,并在自定义组件选项卡中找到了新的PlotView组件。

问题是,我无法从"工具"选项卡将组件添加到"表单"中,所以我在源文件中编写了等效语句。

构建过程很顺利,应用程序也很好,但现在我在设计器选项卡中看不到表单,而是收到了以下消息:

Failed to load designer. Check the source code for syntax errors and check if all references are available.
ICSharpCode.FormsDesigner.FormsDesignerLoadException: System.ComponentModel.Design.Serialization.CodeDomSerializerException: Could not find type 'OxyPlot.WindowsForms.PlotView'.  Please make sure that the assembly that contains this type is referenced.  If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU.
System.ComponentModel.Design.Serialization.CodeDomSerializerException: The variable 'plot1' is either undeclared or was never assigned.
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)

   at ICSharpCode.FormsDesigner.FormsDesignerViewContent.LoadDesigner()
   at ICSharpCode.FormsDesigner.FormsDesignerViewContent.LoadAndDisplayDesigner()
   at ICSharpCode.FormsDesigner.FormsDesignerViewContent.LoadInternal(OpenedFile file, Stream stream)
   at ICSharpCode.SharpDevelop.Workbench.AbstractViewContentHandlingLoadErrors.Load(OpenedFile file, Stream stream)

我该如何解决这个问题?

sharpdevel未能加载设计器

SharpDevelop 5.1中似乎有一个错误无法解析OxyPlot程序集。

看起来SharpDevelop 4.4没有同样的问题,可以在设计器中打开表单。

作为SharpDevelop 5.1的解决方法,您可以将OxyPlot.dll和OxyPlot.WindowsForms.dll文件复制到C:''Program files(x86)''SharpDevelop''5.1''bin 中

然后重新启动SharpDevelop,然后您就可以在设计器中打开表单而不会出现任何错误。

此错误应在SharpDevelop 5.1.0.5173及更高版本中修复。