Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Unspecified error - in Form Designer of Visual C# 2008 Express
 

Unspecified error - in Form Designer of Visual C# 2008 Express

Folks,

I have a very simple application, consisting of a standard Program.cs, an "empty" Form1, and an extra class, which must be instantiated in main and "injected" into Form1... and I'm getting an when I try to display the Form Designer... so I can't "populate" the Form with the desired controls.

Visual C# 2008 Express SP1 - Version 9.0.30729.1 on Windows Vista Ultimate (32bit) on an AMD64

This was intended to be an SCCEE for another problem (which I posted to StackOverflow).

1 Error
Unspecified error 
at EnvDTE.FileCodeModel.get_CodeElements()
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.Parse(TextReader codeStream)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.MergedCodeDomParser.System.CodeDom.Compiler.ICodeParser.Parse(TextReader stream)
at System.CodeDom.Compiler.CodeDomProvider.Parse(TextReader codeStream)
at Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.CodeDomDocDataAdapter.get_CompileUnit()
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host) 

Program.cs
using
 System;
using
 System.Windows.Forms;

namespace
 ShowFormOnTop
{
    static
 class
 Program {
        [STAThread]
        static
 void
 Main() {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false
);
            SomeOtherClass other = new
 SomeOtherClass();
            Application.Run(new
 Form1(other));
        }
    }
}

Form1.cs
using
 System;
using
 System.Windows.Forms;

namespace
 ShowFormOnTop {
    public
 partial
 class
 Form1 : Form {
        private
 readonly
 SomeOtherClass other;
        public
 Form1() {
        }
        public
 Form1(SomeOtherClass other) {
            InitializeComponent();
            this
.other = other;
        }
    }
}


Form1.Designer.cs
using System;
using System.Windows.Forms;

namespace ShowFormOnTop {
    partial class Form1 {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing) {
            if (disposing && (components != null)) {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent() {
            this.components = new System.ComponentModel.Container();
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Text = "Form1";
        }

        #endregion
    }
}


SomeOtherClass.cs

using System;

namespace ShowFormOnTop {
    public class SomeOtherClass {
        public SomeOtherClass() {
        }
        void doNothing() {
        }
    }
}

Any insights would be appreciated... In the meantime I think I'll just start a fresh project (it's so small), and hope I don't trigger the problem.

Cheers. Keith.
corlettk  Friday, June 12, 2009 3:45 PM
Hi Keith,

I just tried to reproduce your problem based on the description and code, but the problem can't be reproduced. If you start a fresh project, does the problem still exist?

Best regards,
Bruce Zhou
Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Wednesday, June 17, 2009 2:11 AM
We are changing the issue type to “General Discussion�because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question�by opening the Options list at the top of the post editor window, and changing the type. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.
Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Monday, June 22, 2009 2:49 AM

You can use google to search for other answers

Custom Search

More Threads

• Difference between arrays and objects when referencing controls
• MenuStrip and Toolstrip Sound
• Designer Problem With Visual Studio 2005
• Disable Enter in GridColumnStyle
• Component
• how to implement mousedrag event in c#
• Textbox with a Date
• visibility
• How to make an application containg WinForms designer ?
• Code Snippet: System.Component Model Namespace