MZ-Tools Articles Series: BUG: EnvDTE.CodeFunction.Parameters causes COM Exception with C# event add/remove methods in Visual Studio macros or add-ins

And yet another bug in the file code model of C# that happens with events:

BUG: EnvDTE.CodeFunction.Parameters causes COM exception with C# event add/remove methods in Visual Studio macros or add-ins:
http://www.mztools.com/articles/2009/MZ2009019.aspx

Curiously this didn’t happen with VS.NET 2002/2003 when CodeEvent didn’t exist (it was introduced as EnvDTE80.CodeEvent in VS 2005) and C# events were mapped to EnvDTE.CodeProperty.

I have also reported it to Microsoft through Microsoft Connect.