sharpdevelop无法加载设计器

时间:2015-10-30 16:38:32

标签: c# sharpdevelop oxyplot

我使用 Sharpdevelop 5.1.0.5134 .NET 4.5.51209 基于 Windows.Forms

制作桌面应用程序

首先,一切都很好,没有警告,设计师正确显示表格,我可以轻松添加组件。

之后我从软件包管理控制台中正确添加了 OxyPlot ,我在自定义组件<中找到了新的 PlotView 组件/ strong>标签。

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

构建过程很顺利,应用程序工作正常,但现在我无法在设计器选项卡中看到Form,而是收到了此消息:

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)

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

看起来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及更高版本中修复。