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.