- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何修复 Windows 窗体设计器中的设计时错误?
当我单击 MyMainForm.cs[Design] 页面以调出 WinForms 时,出现以下错误:
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)
这是我在 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
如果您需要查看我的一些代码来帮助我,请告诉我
这是 MainForm.Designer.cs 文件代码:
namespace CCP_Utility
{
partial class MainForm
{
/// <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.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();
//
// button_Execute
//
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;
//
// listBox1
//
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);
//
// folderPath
//
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);
//
// label1
//
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:";
//
// targetPath
//
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);
//
// targetFolderBrowserDialog
//
this.targetFolderBrowserDialog.Description = "targetFolderBrowserDialog";
//
// label3
//
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);
//
// textBoxSourceDir
//
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);
//
// textBoxTargetDir
//
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);
//
// button_SaveSearch
//
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);
//
// groupBox2
//
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);
//
// buttonClearLog
//
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.buttonClearLog.Click += new System.EventHandler(this.buttonClearLog_Click);
//
// buttonCancelSearch
//
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.buttonCancelSearch.Click += new System.EventHandler(this.buttonCancelSearch_Click);
//
// sourceFileOpenFileDialog
//
this.sourceFileOpenFileDialog.DefaultExt = "xlsx";
this.sourceFileOpenFileDialog.InitialDirectory = "I:\\CommissisionReconciliation\\Review\\";
//
// sourceFolderBrowserDialog
//
// this.sourceFolderBrowserDialog.HelpRequest += new System.EventHandler(this.folderBrowserDialog1_HelpRequest);
//
// textBoxSourceFiles
//
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);
//
// sourceFiles
//
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);
//
// MainForm
//
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.Load += new System.EventHandler(this.Form1_Load);
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;
}
}
最佳答案
尝试关闭解决方案,重新打开它,然后打开表单。根据我的经验,错误可能会消失,但稍后会再次出现。
如果错误没有消失,则根据
http://connect.microsoft.com/VisualStudio/feedback/details/497218/the-class-name-is-not-a-valid-identifier-for-this-language-can-reproduce-w-vs-2008
和
http://social.msdn.microsoft.com/Forums/en/winformsdesigner/thread/f2c1a027-3e49-4f7f-a4c2-c91a8fde25fc
你可能在某处有太多的右括号。
关于C# Visual Studio 2008 - Windows 窗体设计器中的设计时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5382967/
关闭。这个问题需要更多focused .它目前不接受答案。 想改善这个问题吗?更新问题,使其仅关注一个问题 editing this post . 4年前关闭。 Improve this questi
.NET 框架:4.5.1 我在 Blend for visual studio 2015 中遇到一个奇怪的错误,我找不到它的来源。 如果我在 VS 中打开我的 WPF 解决方案,它会加载并运行良好。
我经常遇到这样的问题,与 Hierarchical RESTful URL design 非常相似 假设该服务仅提供用户上传文档。 POST, GET /accounts PUT, DELETE /a
在 Rails 应用程序中,我使用 devise 来管理我的用户,而我用来销毁 session 的链接不再有效。它正在工作,现在我添加了事件管理员,但没有。 我的链接是 :delete, :clas
我已经坚持了超过 24 小时,试图按照此处发布的其他解决方案进行操作,但我无法使其正常工作。我是 Rails 新手,需要帮助! 我想让我的/users/edit 页面正常工作,以便我可以简单地更改用户
Devise 在以下情况下不会使用户超时: 用户登录,关闭选项卡,然后在超时 + X 分钟内重新访问该 URL。用户仍处于登录状态。 如果选项卡已打开并且稍后刷新/单击,则超时可以正常工作。这意味着
我想使用这样的 slider 我希望该 slider 根据提供给它的值进行相应调整。到目前为止,我只能应用具有渐变效果的背景,但无法获得这种效果。请通过提供样式代码来帮助我。
您应该为每种方法创建一个请求/响应对象,还是应该为每个服务创建一个? 如果我在所有方法中使用它,我的服务请求对象中将只有 5 个不同的东西,因为我对几乎所有方法使用相同的输入。 响应对象将只有一个字典
我正在尝试在 REST 中对实体的附件进行建模。假设一个缺陷实体可以附加多个附件。每个附件都有描述和一些其他属性(上次修改时间、文件大小...)。附件本身是任何格式的文件(jpeg、doc ...)
我有以下表格: Blogs { BlogName } BlogPosts { BlogName, PostTitle } 博客文章同时建模一个实体和一个关系,根据 6nf(根据第三个宣言)这是无效的。
如果 A 类与 B、C 和 D 类中的每一个都有唯一的交互,那么交互的代码应该在 A 中还是在 B、C 和 D 中? 我正在编写一个小游戏,其中许多对象可以与其他对象进行独特的交互。例如,EMP点击
关于如何记住我与 Omniauth 一起工作似乎有些困惑。 根据这个wiki ,您需要在 OmniauthCallbacksController 中包含以下内容: remember_me(user)
设计问题: 使用 非线程安全 组件(集合,API,...)在/带有 多线程成分 ... 例子 : 组件 1 :多线程套接字服务器谁向消息处理程序发送消息... 组件 2 :非线程安全 消息处理程序 谁
我们目前正在设计一个 RESTful 应用程序。我们决定使用 XML 作为我们的基本表示。 我有以下关于在 XML 中设计/建模应用程序数据的问题。 在 XML 中进行数据建模的方法有哪些?从头开始然
我正在设计一个新的 XSD 来从业务合作伙伴那里获取积分信息。对于每笔交易,合作伙伴必须提供至少一种积分类型的积分值。我有以下几点:
设计支持多个版本的 API 的最佳方法是什么。我如何确保即使我的数据架构发生更改(微小更改),我的 api 的使用者也不会受到影响?任何引用架构、指南都非常有用。 最佳答案 Mark Nottingh
关闭。这个问题是opinion-based 。目前不接受答案。 想要改进这个问题吗?更新问题,以便 editing this post 可以用事实和引文来回答它。 . 已关闭 4 年前。 Improv
我想用 php 创建一个网站,其工作方式与 https://www.bitcoins.lc/ 相同。确实,就每个页面上具有相同布局但内容会随着您更改链接/页面而改变而言,我如何在 php 中使用lay
我有一个关于编写 Swing UI 的问题。如果我想制作一个带有某些选项的软件,例如在第一个框架上,我有三个按钮(新建、选项、退出)。 现在,如果用户单击新按钮,我想将框架中的整个内容更改为其他内容。
我正在尝试找出并学习将应用程序拥有的一堆Docker容器移至Kubernetes的模式和最佳实践。诸如Pod设计,服务,部署之类的东西。例如,我可以创建一个其中包含单个Web和应用程序容器的Pod,但
我是一名优秀的程序员,十分优秀!