0

I saw this thread but the manual way takes forever and the macro is good but every time I run it all my event handlers get erased by Visual Studio when it parses the designer file. Also the macro is a bit old and places sections and functions in a different way than contemporary Visual Studio does so that's a bit annoying as well.

I have to do this to around 20 forms and every single one so far is taking over a half an hour (they're huge) and is prone to error because I may forget to relink something. Does anyone know of a better way? Or at least a way to make it so Visual Studio doesn't erase the event handlers when reparsing the designer file.

Community
  • 1
  • 1
Ryan Peschel
  • 11,087
  • 19
  • 74
  • 136

1 Answers1

0

The problem was that the event handlers and other designer code didn't use the fully qualified namespaces and this for assignments. As a result, when Visual Studio parsed the designer code in the partial class, a lot of event handlers were erased because they weren't in the proper format.

The fix was to go through all the designer code beforehand and make sure this was used everywhere and that all classes were used with their fully qualified namespaces before running the macro script.

Ryan Peschel
  • 11,087
  • 19
  • 74
  • 136