Few months ago, I was writing a plugin on opportunity setstate. I registered the plugin using registeration tool. My plugin never get triggered. After messing around for few hours, I registered the plugin on SetStateDynamicEntity message. Even then when I closed the opportunity, the plugin did not trigger, did not matter if it's won or lost opportunity, But plugin did trigger when I reopened the closed opportunity. I tried a lot of different things and at the end I registerfed my pluggin for win and lose message instead of setstate or setstatedynamicentity message. It worked this time.
I hope this will help some of you guys facing the same problem.
Have a nice weekend.