How to fix Design-Time error in Windows Form Designer?
When I click on the MyMainForm.cs [Design] page to call WinForms, I get the following error:
To prevent possible data loss before loading the designer, the following errors must be resolved:
The class name '?' is not a valid identifier for this language.
Instances of this error (1)
1. Hide Call Stack
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.CodeTypeDeclarationFromCodeClass(CodeClass vsClass)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.OnNamespacePopulateTypes(Object sender, EventArgs e)
at System.CodeDom.CodeNamespace.get_Types()
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 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
Here are my errors in MainForm.Designer.cs:
Warning 1 The class name '?' is not a valid identifier for this language. 0 0 (No File Referenced, clicking on this warning does nothing)
Error 1 'CCP_Utility.MainForm' does not contain a definition for 'sourceFiles_Click' and no extension method 'sourceFiles_Click' accepting a first argument of type 'CCP_Utility.MainForm' could be found (are you missing a using directive or an assembly reference?) C:\Users\bmccarthy\Documents\Visual Studio 2008\Projects\CCP Utility\CCP Utility\MainForm.Designer.cs 84 67 CCP Utility
Error 2 'CCP_Utility.MainForm' does not contain a definition for 'targetFolderPath_Click' and no extension method 'targetFolderPath_Click' accepting a first argument of type 'CCP_Utility.MainForm' could be found (are you missing a using directive or an assembly reference?) C:\Users\bmccarthy\Documents\Visual Studio 2008\Projects\CCP Utility\CCP Utility\MainForm.Designer.cs 104 67 CCP Utility
Error 3 'CCP_Utility.MainForm' does not contain a definition for 'sourceFolderPath_Click' and no extension method 'sourceFolderPath_Click' accepting a first argument of type 'CCP_Utility.MainForm' could be found (are you missing a using directive or an assembly reference?) C:\Users\bmccarthy\Documents\Visual Studio 2008\Projects\CCP Utility\CCP Utility\MainForm.Designer.cs 118 63 CCP Utility
Error 4 'CCP_Utility.MainForm' does not contain a definition for 'textBoxSourceDir_TextChanged' and no extension method 'textBoxSourceDir_TextChanged' accepting a first argument of type 'CCP_Utility.MainForm' could be found (are you missing a using directive or an assembly reference?) C:\Users\bmccarthy\Documents\Visual Studio 2008\Projects\CCP Utility\CCP Utility\MainForm.Designer.cs 128 79 CCP Utility
Error 5 'CCP_Utility.MainForm' does not contain a definition for 'textBoxTargetDirectory_TextChanged' and no extension method 'textBoxTargetDirectory_TextChanged' accepting a first argument of type 'CCP_Utility.MainForm' could be found (are you missing a using directive or an assembly reference?) C:\Users\bmccarthy\Documents\Visual Studio 2008\Projects\CCP Utility\CCP Utility\MainForm.Designer.cs 138 79 CCP Utility
Error 6 'CCP_Utility.MainForm' does not contain a definition for 'button_SaveSearch_Click' and no extension method 'button_SaveSearch_Click' accepting a first argument of type 'CCP_Utility.MainForm' could be found (are you missing a using directive or an assembly reference?) C:\Users\bmccarthy\Documents\Visual Studio 2008\Projects\CCP Utility\CCP Utility\MainForm.Designer.cs 151 74 CCP Utility
Error 7 'CCP_Utility.MainForm' does not contain a definition for 'groupBox2_Enter' and no extension method 'groupBox2_Enter' accepting a first argument of type 'CCP_Utility.MainForm' could be found (are you missing a using directive or an assembly reference?) C:\Users\bmccarthy\Documents\Visual Studio 2008\Projects\CCP Utility\CCP Utility\MainForm.Designer.cs 164 66 CCP Utility
Let me know if you need to see any of my codes to help me.
Here is the file of the MainForm.Designer.cs file:
namespace CCP_Utility
{
partial class MainForm
{
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
private void InitializeComponent()
{
this.button_Execute = new System.Windows.Forms.Button();
this.listBox1 = new System.Windows.Forms.ListBox();
this.folderPath = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.targetPath = new System.Windows.Forms.Button();
this.targetFolderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
this.label3 = new System.Windows.Forms.Label();
this.textBoxSourceDir = new System.Windows.Forms.TextBox();
this.textBoxTargetDir = new System.Windows.Forms.TextBox();
this.button_SaveSearch = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.buttonClearLog = new System.Windows.Forms.Button();
this.buttonCancelSearch = new System.Windows.Forms.Button();
this.sourceFileOpenFileDialog = new System.Windows.Forms.OpenFileDialog();
this.sourceFolderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
this.textBoxSourceFiles = new System.Windows.Forms.TextBox();
this.sourceFiles = new System.Windows.Forms.Button();
this.SuspendLayout();
this.button_Execute.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.button_Execute.Location = new System.Drawing.Point(12, 148);
this.button_Execute.Name = "button_Execute";
this.button_Execute.Size = new System.Drawing.Size(114, 23);
this.button_Execute.TabIndex = 11;
this.button_Execute.Text = "Search";
this.button_Execute.TextAlign = System.Drawing.ContentAlignment.TopCenter;
this.button_Execute.UseVisualStyleBackColor = true;
this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listBox1.Font = new System.Drawing.Font("Calibri", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listBox1.FormattingEnabled = true;
this.listBox1.ItemHeight = 18;
this.listBox1.Location = new System.Drawing.Point(21, 220);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(743, 184);
this.listBox1.TabIndex = 15;
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
this.folderPath.Location = new System.Drawing.Point(12, 59);
this.folderPath.Name = "folderPath";
this.folderPath.Size = new System.Drawing.Size(117, 23);
this.folderPath.TabIndex = 1;
this.folderPath.Text = "Source Directory";
this.folderPath.TextAlign = System.Drawing.ContentAlignment.TopCenter;
this.folderPath.UseVisualStyleBackColor = true;
this.folderPath.Click += new System.EventHandler(this.sourceFiles_Click);
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 94);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(130, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Choose the Target Folder:";
this.targetPath.Location = new System.Drawing.Point(12, 110);
this.targetPath.Name = "targetPath";
this.targetPath.Size = new System.Drawing.Size(114, 23);
this.targetPath.TabIndex = 3;
this.targetPath.Text = "Target Directory";
this.targetPath.TextAlign = System.Drawing.ContentAlignment.TopCenter;
this.targetPath.UseVisualStyleBackColor = true;
this.targetPath.Click += new System.EventHandler(this.targetFolderPath_Click);
this.targetFolderBrowserDialog.Description = "targetFolderBrowserDialog";
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 43);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(133, 13);
this.label3.TabIndex = 6;
this.label3.Text = "Choose the Source Folder:";
this.label3.Click += new System.EventHandler(this.sourceFolderPath_Click);
this.textBoxSourceDir.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBoxSourceDir.Location = new System.Drawing.Point(135, 59);
this.textBoxSourceDir.Name = "textBoxSourceDir";
this.textBoxSourceDir.Size = new System.Drawing.Size(395, 20);
this.textBoxSourceDir.TabIndex = 2;
this.textBoxSourceDir.TextChanged += new System.EventHandler(this.textBoxSourceDir_TextChanged);
this.textBoxTargetDir.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBoxTargetDir.Location = new System.Drawing.Point(135, 110);
this.textBoxTargetDir.Name = "textBoxTargetDir";
this.textBoxTargetDir.Size = new System.Drawing.Size(395, 20);
this.textBoxTargetDir.TabIndex = 4;
this.textBoxTargetDir.TextChanged += new System.EventHandler(this.textBoxTargetDirectory_TextChanged);
this.button_SaveSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button_SaveSearch.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.button_SaveSearch.Location = new System.Drawing.Point(361, 177);
this.button_SaveSearch.Name = "button_SaveSearch";
this.button_SaveSearch.Size = new System.Drawing.Size(151, 23);
this.button_SaveSearch.TabIndex = 12;
this.button_SaveSearch.Text = "Save Search";
this.button_SaveSearch.TextAlign = System.Drawing.ContentAlignment.TopCenter;
this.button_SaveSearch.UseVisualStyleBackColor = true;
this.button_SaveSearch.Click += new System.EventHandler(this.button_SaveSearch_Click);
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox2.Location = new System.Drawing.Point(15, 206);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(762, 206);
this.groupBox2.TabIndex = 20;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Logging Window";
this.groupBox2.Enter += new System.EventHandler(this.groupBox2_Enter);
this.buttonClearLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClearLog.Location = new System.Drawing.Point(361, 148);
this.buttonClearLog.Name = "buttonClearLog";
this.buttonClearLog.Size = new System.Drawing.Size(151, 23);
this.buttonClearLog.TabIndex = 13;
this.buttonClearLog.Text = "Clear Log";
this.buttonClearLog.TextAlign = System.Drawing.ContentAlignment.TopCenter;
this.buttonClearLog.UseVisualStyleBackColor = true;
this.buttonCancelSearch.Location = new System.Drawing.Point(135, 148);
this.buttonCancelSearch.Name = "buttonCancelSearch";
this.buttonCancelSearch.Size = new System.Drawing.Size(111, 23);
this.buttonCancelSearch.TabIndex = 21;
this.buttonCancelSearch.Text = "Cancel Search";
this.buttonCancelSearch.TextAlign = System.Drawing.ContentAlignment.TopCenter;
this.buttonCancelSearch.UseVisualStyleBackColor = true;
this.sourceFileOpenFileDialog.DefaultExt = "xlsx";
this.sourceFileOpenFileDialog.InitialDirectory = "I:\\CommissisionReconciliation\\Review\\";
this.textBoxSourceFiles.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBoxSourceFiles.Location = new System.Drawing.Point(135, 12);
this.textBoxSourceFiles.Name = "textBoxSourceFiles";
this.textBoxSourceFiles.Size = new System.Drawing.Size(395, 20);
this.textBoxSourceFiles.TabIndex = 22;
this.textBoxSourceFiles.TextChanged += new System.EventHandler(this.textBoxSourceFiles_TextChanged);
this.sourceFiles.Location = new System.Drawing.Point(12, 12);
this.sourceFiles.Name = "sourceFiles";
this.sourceFiles.Size = new System.Drawing.Size(117, 23);
this.sourceFiles.TabIndex = 23;
this.sourceFiles.Text = "Select Files";
this.sourceFiles.TextAlign = System.Drawing.ContentAlignment.TopCenter;
this.sourceFiles.UseVisualStyleBackColor = true;
this.sourceFiles.Click += new System.EventHandler(this.sourceFiles_Click_1);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(841, 424);
this.Controls.Add(this.sourceFiles);
this.Controls.Add(this.textBoxSourceFiles);
this.Controls.Add(this.buttonCancelSearch);
this.Controls.Add(this.buttonClearLog);
this.Controls.Add(this.button_SaveSearch);
this.Controls.Add(this.textBoxTargetDir);
this.Controls.Add(this.textBoxSourceDir);
this.Controls.Add(this.label3);
this.Controls.Add(this.targetPath);
this.Controls.Add(this.label1);
this.Controls.Add(this.folderPath);
this.Controls.Add(this.button_Execute);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.groupBox2);
this.MinimumSize = new System.Drawing.Size(857, 361);
this.Name = "MainForm";
this.Text = "CCP Commission File Consolidation Process Utility v1.0.0";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button_Execute;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.Button folderPath;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button targetPath;
private System.Windows.Forms.FolderBrowserDialog targetFolderBrowserDialog;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBoxSourceDir;
private System.Windows.Forms.TextBox textBoxTargetDir;
private System.Windows.Forms.Button button_SaveSearch;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button buttonClearLog;
private System.Windows.Forms.Button buttonCancelSearch;
private System.Windows.Forms.OpenFileDialog sourceFileOpenFileDialog;
private System.Windows.Forms.FolderBrowserDialog sourceFolderBrowserDialog;
private System.Windows.Forms.TextBox textBoxSourceFiles;
private System.Windows.Forms.Button sourceFiles;
}
}