Dr. eX: Why does GetService(typeof(EnvDTE.DTE)) return null?

Ever build a Visual Studio package with code that looks like the following? protected override void Initialize() { base.Initialize();             this.dte = GetService(typeof(DTE)) as DTE; …… } And then realize later on that this.dte is null? A number of Visual Studio integrators have encountered just this problem in the past, and having recently seen this…

2

Dr. eX: How can I programmatically add a database connection to the server explorer toolwindow with my add-in?

For VS 2008, you can use the IVsDataExplorerConnectionManager.AddConnection method.The easiest way to retrieve this interface is with the help of the Visual Studio SDK. You’ll need to install the VS SDK and add the following references to your add-in project. Microsoft.VisualStudio.OLE.Interop.dll Microsoft.VisualStudio.Shell.9.0.dll Microsoft.VisualStudio.Data.dll Microsoft.VisualStudio.Data.Core.dll Microsoft.VisualStudio.Data.Framework.dll Microsoft.VisualStudio.Data.Services.dll Add the following using statements to your connect.cs file:  …

0