I am attempting my first Visual Studio 2010 plugin and am attempting to reference the ActiveSolutionProjects like so
private DTE2 _applicationObject;
public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
_applicationObject = (DTE2)application;
...
}
private void load()
{
var theProjects = (System.Array)_applicationObject.ActiveSolutionProjects;
...
}
The
var theProjects = (System.Array)_applicationObject.ActiveSolutionProjects;
line fails with
Error HRESULT E_FAIL has been returned from a call to a COM component. ErrorCode -2147467259
Any idea how I fix this error?