Advertisement

05.09.2008 at 10:54AM PDT, ID: 23390309
[x]
Attachment Details

How to get the currently active instance of Visual Studio Development Environment

Asked by Russ_Suter in Microsoft Visual C#.Net, C# Programming Language, Visual Studio .NET 2005

From another post on this site, I got the attached code snippet. The problem with this code is that it retrieves the first instance of Visual Studio that it finds. If multiple instances of VS are running, it may not correctly return the current instance. Does anyone know how to make sure that I retrieve the current instance and not just the first one it finds?Start Free Trial
1:
EnvDTE.DTE dte = (EnvDTE.DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE");
[+][-]05.09.2008 at 11:23AM PDT, ID: 21535308

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, C# Programming Language, Visual Studio .NET 2005
Sign Up Now!
Solution Provided By: DarkoLord
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628