Missing Partial Class Part
-
I'll use short, uncluttered examples to show what just happened to me. It's not really a bug, but still not a WTF (to me yes, not to the reader), so, I had a complex form, Form1, and decided to move some functions to a new form, NewForm (not necessary to show). I cut and pasted all the necessary to the new form and tried a compile. I get one error: error CS0115: 'NoCompile.Form1.Dispose(bool)': no suitable method found to override Form1.Designer.cs:
partial class Form1 { private System.ComponentModel.IContainer components = null; protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } }
OK, so maybe we don't know our parent has a virtual Dispose method. The other half of the partial class: Form1.cs:public partial class Form1 : Form { public Form1() { InitializeComponent(); } }
WTF? Then I remembered: When I moved all the stuff over to the new form, I was in a hurry to see if it worked, and didn't want to worry about problems in the old form. So, I made the 'Build Action' property of Form1.cs 'None'. VS2005 doesn't think it's a good idea to propogate this down to Form1.Designer.cs, which I didn't even have expanded to remind me about it.My Blog