Advertisement

07.21.2008 at 09:33AM PDT, ID: 23582397
[x]
Attachment Details

How to resolve compile time errors on obsolete methods

Asked by rturney in Microsoft Visual C#.Net

I am not sure how to handle compile time errors that occur when a method has been removed or commented out.

For instance,  I deleted a ToolStripMenuItem that has a method associated with it.  When I recompile I get the following error:
"MyProg.Form1' does not contain a definition for 'printPreviewBOMToolStripMenuItem_Click".

The problem code is located in Form1.Designer.cs
            this.printPreviewBOMToolStripMenuItem.Name = "printPreviewBOMToolStripMenuItem";
            this.printPreviewBOMToolStripMenuItem.Size = new System.Drawing.Size(217, 22);
            this.printPreviewBOMToolStripMenuItem.Text = "Print BOM";
            this.printPreviewBOMToolStripMenuItem.Click += new System.EventHandler(this.printPreviewBOMToolStripMenuItem_Click);

Should I comment out the offending code in Form1.Designer.cs?  Or would something like Refactor be the way to handle this?Start Free Trial
[+][-]07.21.2008 at 10:29AM PDT, ID: 22052486

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual C#.Net
Sign Up Now!
Solution Provided By: jaime_olivares
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.21.2008 at 10:33AM PDT, ID: 22052515

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 10:45AM PDT, ID: 22052636

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628