I have come across what I think is the same issue, here are the steps to reproduce what I am seeing:
open VS2005, File, open, Other Project Types, Extensibility, Visual Studio Add-in
Use c#
check both Microsoft Visual Studio 2005 and 2005 Macros
check create tools menu and load when app starts
add reference to :
C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\Microsoft.SqlServer.SqlTools.VSIntegration.dll
C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlWorkbench.Interfaces.dll
add this line to the top of the OnConnection method:
Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.IObjectExplorerService _ObjectExplorer = Microsoft.SqlServer.Management.UI.VSIntegration.ServiceCache.GetObjectExplorer();
Run project, the above line generates the following error:
"Object reference not set to an instance of an object."
and the instance Microsoft.SqlServer.Management.UI.VSIntegration.ServiceCache is not null (I can for example get to Microsoft.SqlServer.Management.UI.VSIntegration.ServiceCache.FullPathToDta)
Thanks,
Mark