How to get VC# to rebuild auto-generated .cs files?

Posted by Jive Dadson on Stack Overflow See other posts from Stack Overflow or by Jive Dadson
Published on 2012-09-05T03:34:52Z Indexed on 2012/09/05 3:38 UTC
Read the original article Hit count: 133

Filed under:
|

I imagine this question has been asked and answered, but I cannot find it.

I wanted to make a simple GUI to interface to a windows 7 command. I usually use Wx, but since this was to be a windows-only thing, I decided to see if I could whip it out real fast using Visual C# 2010 Express, which I had never used before.

Things started off just great. I created a form, put a few buttons and text boxes and such on it, and hit Debug. It came up and ran just like that. No muss, no fuss. So I then designed the form just the way I wanted it, renamed the controls from "Button1" and so forth to meaningful names. But now it's a mess. By clicking around, I discovered that VC# had auto-generated two files called Form1.cs and Form1.Designer.cs. The later contains the bindings between functions and the events generated from user-clicks etc., and the former contains no-op code for those functions, for me to complete.

Problem is, the names are all still the original "Button1" and so forth, not the new ones, and the new controls I added after running the first time do not appear at all.

I want it to regenerate all that stuff afresh from the finished form. How to?

© Stack Overflow or respective owner

Related posts about c#

Related posts about visual-studio-2010