System.ComException in v2 of WSSF

Topics: General Discussion Forum, July and December Releases Forum
Jul 27, 2007 at 9:05 PM
Looking at, modifying and stepping through the Dec 2006 release of WSSF I'm getting an odd exception from the method => FileCodeModelHelper::InspectBaseCodeElement

I'm passing in a Type with this signature:

public class MyClass : MyBaseClass, IMyInterface {...}

The method in question returns a exception when it foreach's through the Interfaces of MyClass that are in the form of CodeElement .

... CodeClass target = (CodeClass)element;
foreach (CodeElement interfaceType in target.ImplementedInterfaces)
{
if (interfaceType.Kind == elementKind &&
interfaceType.FullName.Equals(targetFullName, StringComparison.InvariantCultureIgnoreCase))
{
return interfaceType;
} ...


It chokes on the interface.FullName property and throws 'interfaceType.FullName' threw an exception of type 'System.Runtime.InteropServices.COMException' , however the Name property returns IMyInterface. Inspecting the interface field looks as if many of the properties simply return this ComException?

Is there a special trick when using EnvDTE like registering the project for COM interop or something that I may be missing?

Any insight would be appreciated