myfyireporting causes Exception in SharpDevelop's Form Designer

326 views Asked by At

I have SharpDevelop 5.1 and I am trying to test out My-FyiReporting. All I have is a mainform, a My-fyireporting RDLViewer and a My-fyireporting toolstrip. The viewer works fine when I run the program, but for some reason it causes an exception in the SharpDevelop form designer. This was working yesterday for some reason, but today when I was trying to use this I noticed that the form designer would not load.

My program just has an RDLViewer called rdlViewer1 and a toolstrip called viewerToolstrip1. I have not added any code to any of the .cs source files, as I am just trying to test out the my-fyireporting system.

Here is the Exception in the form builder's MainForm.Designer.cs file:

Failed to load designer. Check the source code for syntax errors and check if all references are available.

ICSharpCode.FormsDesigner.FormsDesignerLoadException: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'RdlEngine, Version=4.12.5881.19802, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
   at fyiReporting.RdlViewer.RdlViewer..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.SecurityUtils.SecureConstructorInvoke(Type type, Type[] argTypes, Object[] args, Boolean allowNonPublic, BindingFlags extraFlags)
   at System.ComponentModel.ReflectTypeDescriptionProvider.CreateInstance(IServiceProvider provider, Type objectType, Type[] argTypes, Object[] args)
   at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.CreateInstance(IServiceProvider provider, Type objectType, Type[] argTypes, Object[] args)
   at System.ComponentModel.TypeDescriptor.CreateInstance(IServiceProvider provider, Type objectType, Type[] argTypes, Object[] args)
   at System.ComponentModel.Design.DesignSurface.CreateInstance(Type type)
   at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
   at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
   at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeInstance(IDesignerSerializationManager manager, Type type, Object[] parameters, String name, Boolean addToContainer)
   at System.ComponentModel.Design.Serialization.ComponentCodeDomSerializer.DeserializeInstance(IDesignerSerializationManager manager, Type type, Object[] parameters, String name, Boolean addToContainer)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
   at System.ComponentModel.Design.Serialization.CodeDomSerializer.DeserializeStatementToInstance(IDesignerSerializationManager manager, CodeStatement statement)
   at System.ComponentModel.Design.Serialization.CodeDomSerializer.Deserialize(IDesignerSerializationManager manager, Object codeObject)
   at ICSharpCode.FormsDesigner.Services.ProjectResourcesComponentCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, Object codeObject)
   at System.Windows.Forms.Design.ControlCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, Object codeObject)
   at ICSharpCode.FormsDesigner.Services.ProjectResourcesComponentCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, Object codeObject)
   at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.DeserializeName(IDesignerSerializationManager manager, String name, CodeStatementCollection statements)

System.ComponentModel.Design.Serialization.CodeDomSerializerException: The variable 'rdlViewer1' 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.DeserializePropertyAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)

System.ComponentModel.Design.Serialization.CodeDomSerializerException: The variable 'rdlViewer1' 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)

Here is the code in the MainForm.Designer.cs file:

namespace fyireport_test
{
    partial class MainForm
    {
        /// <summary>
        /// Designer variable used to keep track of non-visual components.
        /// </summary>
        private System.ComponentModel.IContainer components = null;
        private fyiReporting.RdlViewer.RdlViewer rdlViewer1;
        private fyiReporting.RdlViewer.ViewerToolstrip viewerToolstrip1;

        /// <summary>
        /// Disposes resources used by the form.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing) {
                if (components != null) {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        /// <summary>
        /// This method is required for Windows Forms designer support.
        /// Do not change the method contents inside the source code editor. The Forms designer might
        /// not be able to load this method if it was changed manually.
        /// </summary>
        private void InitializeComponent()
        {
            this.rdlViewer1 = new fyiReporting.RdlViewer.RdlViewer();
            this.viewerToolstrip1 = new fyiReporting.RdlViewer.ViewerToolstrip();
            this.SuspendLayout();
            // 
            // rdlViewer1
            // 
            this.rdlViewer1.Cursor = System.Windows.Forms.Cursors.Default;
            this.rdlViewer1.dSubReportGetContent = null;
            this.rdlViewer1.Folder = null;
            this.rdlViewer1.HighlightAll = false;
            this.rdlViewer1.HighlightAllColor = System.Drawing.Color.Fuchsia;
            this.rdlViewer1.HighlightCaseSensitive = false;
            this.rdlViewer1.HighlightItemColor = System.Drawing.Color.Aqua;
            this.rdlViewer1.HighlightPageItem = null;
            this.rdlViewer1.HighlightText = null;
            this.rdlViewer1.Location = new System.Drawing.Point(89, 42);
            this.rdlViewer1.Name = "rdlViewer1";
            this.rdlViewer1.PageCurrent = 1;
            this.rdlViewer1.Parameters = "";
            this.rdlViewer1.ReportName = null;
            this.rdlViewer1.ScrollMode = fyiReporting.RdlViewer.ScrollModeEnum.Continuous;
            this.rdlViewer1.SelectTool = false;
            this.rdlViewer1.ShowFindPanel = false;
            this.rdlViewer1.ShowParameterPanel = true;
            this.rdlViewer1.ShowWaitDialog = true;
            this.rdlViewer1.Size = new System.Drawing.Size(513, 315);
            this.rdlViewer1.SourceFile = null;
            this.rdlViewer1.SourceRdl = null;
            this.rdlViewer1.TabIndex = 0;
            this.rdlViewer1.UseTrueMargins = true;
            this.rdlViewer1.Zoom = 0.4709417F;
            this.rdlViewer1.ZoomMode = fyiReporting.RdlViewer.ZoomEnum.FitWidth;
            // 
            // viewerToolstrip1
            // 
            this.viewerToolstrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
            this.viewerToolstrip1.Location = new System.Drawing.Point(0, 0);
            this.viewerToolstrip1.Name = "viewerToolstrip1";
            this.viewerToolstrip1.Size = new System.Drawing.Size(719, 27);
            this.viewerToolstrip1.TabIndex = 1;
            this.viewerToolstrip1.Text = "viewerToolstrip1";
            this.viewerToolstrip1.Viewer = this.rdlViewer1;
            // 
            // MainForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(719, 451);
            this.Controls.Add(this.viewerToolstrip1);
            this.Controls.Add(this.rdlViewer1);
            this.Name = "MainForm";
            this.Text = "fyireport test";
            this.ResumeLayout(false);
            this.PerformLayout();

        }
    }
}

I have tried to completely clean the project and solution, rebuild them, and restart SharpDevelop. This did not seem to change anything.

1

There are 1 answers

0
Matt Ward On

You should be able to fix this by copying the RdlEngine.dll file into the SharpDevelop bin directory:

C:\Program Files (x86)\SharpDevelop\5.0\bin

Having the assembly in there should allow the SharpDevelop forms designer to load it.