Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Clever Code
  4. Missing Partial Class Part

Missing Partial Class Part

Scheduled Pinned Locked Moved Clever Code
helpcsharpquestion
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Brady Kelly
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups