Greetings,
We are having big problems working with Visual Studio 2003, it erases
event handlers from C# and VB code.
For example:
1. Open project
2. Open ASPX file with several buttons and event handlers associated
with them
3. Work on the HTML part of the page (design mode)
4. Build the project
5. Run & try the page
No button functions. Go back to the code and there it is: ALL EVENT
HANDLERS HAVE BEEN ERASED. Sometimes the bug appears sometimes it
doesn't.
Our customers are losing patience too, every few deploys they receive
application that does not work - only because of the bug in Visual
Studio 2003 that removes event handle code. Our test department has no
way of testing all buttons, edit boxes etc.
Does anybody know how to deal with this bug?
Unfortunately, the list of Visual Studio 2003 bugs we maintain is
growing each day. Our productivity is suffering badly because of the
problems induced by the new IDE.
Thanks for any info that you might have.
Best regards,
Damir Colak
Brian W - 25 Sep 2003 19:49 GMT
I have seen this too. and reported it on this NG. It is just another in a
long list of bugs in the IDE
Someone from MS wanted a sample project to reproduce the problem, but, as
you are seeing this bug is intermittent and cannot be reproduced
consistently. And there seems to be no pattern.
BTW are you sure it is the event handlers that are being erased? What was
reported before was the assignment of the handlers is being erased
button.Click += new System.EventHandler(this.Button_Click);
I find it hard to believe that nobody at MS has ever experienced this, since
it happens often enough.
Sorry I don't have a solution, all I can suggest is, do what I do, go to the
code behind and check that the code hasn't been removed before you build.
Also, it's generally bad practice to send untested code, even if it weren't
for the IDE problems, sending untested code to a client does nothing but
lessen your credibility, as a capable developer/company.
Good luck
Brian W
> Greetings,
>
[quoted text clipped - 29 lines]
> Best regards,
> Damir Colak
John Saunders - 26 Sep 2003 01:45 GMT
> Greetings,
>
[quoted text clipped - 13 lines]
> HANDLERS HAVE BEEN ERASED. Sometimes the bug appears sometimes it
> doesn't.
If it's this consistent, perhaps you could come up with a small reproducer?

Signature
John Saunders
Internet Engineer
john.saunders@surfcontrol.com
Christian Boult - 29 Sep 2003 21:43 GMT
Attach events manually after the InitializeComponent call, instead of using
the properties editor.
It's a pain but at least the code is not touched by VS IDE so it sticks.
Chris.
> Greetings,
>
[quoted text clipped - 29 lines]
> Best regards,
> Damir Colak