Visual Studio Development Bookmark and Share   
 index > Visual Studio Extensibility > Reference error
 

Reference error

Hi,

I'm currently trying to add functionalities to Server Explorer (add-in of VS)

I'm using the code "IObjectExplorerService objectExplorer = ServiceCache.GetObjectExplorer();" to get a handler to this windows and get an error (object not refered, ...)

This code is placed in "OnConnection" event of my code.

Has anyone an idea ?

Regards,

Stéphane

Suedois  Wednesday, August 15, 2007 9:20 AM

Hi Suedois,

Since you have came across an exception, could you please cover the exception in more details? You can post its stack trace, and inner exceptionhere.

To troubleshoot this issue, we really need the source code to reproduce the problem, so that we can investigate the issue in house. It is not necessary that you send out the complete source of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business logicfrom it.

Thanks!

Feng Chen  Friday, August 17, 2007 5:16 AM

Hi Suedois,

We are changing the issue type to “Comment�because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question�by editing your initial post and changing the radio button at the top of the post editor window. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.

Thank you!

Feng Chen  Monday, August 20, 2007 5:45 AM

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

yzguy  Monday, October 22, 2007 2:28 PM

I found what I needed here:

http://aspalliance.com/1374_Extend_Functionality_in_SQL_Server_2005_Management_Studio_with_Addins.all

I was trying to use this addin with VS 2005 (for testing as I had not gotten it to work with SSMS yet) but I think I was trying touse SSMS specific objects, thus the object reference not set errors. Once I got it to hook into SSMS this worked.

yzguy  Wednesday, October 24, 2007 2:58 PM

You need add another dll in reference, its path like

C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\ObjectExplorer.dll

and add

using Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer;

Zdliang  Saturday, November 03, 2007 4:25 PM

You can use google to search for other answers

Custom Search

More Threads

• Dynamically Create Links OnAttributeChange Event`s
• "No Such Interface Supported" in VS2005 Macros IDE
• Is it possible to get the dbl click event on window panes (like Find pane)
• Does EnvDTE.SourceControl works under clearcase?
• Messagebox shifting the focus
• Project is not visible if always show solution explorer is unchecked
• Problem implementing a new language service
• Opening a csproj file programmatically
• The DomainClass StateElement to which ElementTool ExampleElement refers cannot be abstract?
• where can ı find info about DSL?