“Virtual method call from constructor” What Could Go Wrong?
If you’ve used any sort of static analysis on source code you may have seen a message like “Virtual method call from constructor”. In FxCop/Visual-Studio-Code-Analysis it’s CA2214 “Do not call overridable methods in constructors”. It’s “syntactically correct”; some devs have said “what could go wrong with that”. I’ve seen this problem in so many places, I’m compelled to write this post. I won’t get into one of my many pet peeves about ignoring messages like that and not educating yourself about ticking time bombs and continuing in ignorant bliss; but, I will try to make it more clear and hopefully … Continue reading “Virtual method call from constructor” What Could Go Wrong?