Manual editing of *.designer.cs file

前端 未结 5 1356
时光取名叫无心
时光取名叫无心 2020-11-28 16:29

I\'m aware, that the .designer.cs file contains data generated by the visual form designer in Visual Studio. However, I have some additional methods though, whi

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-28 16:52

    Leaving designer.cs in peace not only prevents your changes from being overwritten, but also helps other developers by saying that nothing unexpected should come out of it. That being said, there is at least one exception I can think of and that is the one mentioned by author of the post: extension of Dispose() method. To my knowledge this code - once generated - will not be overwritten.

    However, in my opinion much better solution is to override the Dispose method and than call the base.Dispose(), so that we leave designer.cs clean.

提交回复
热议问题