0 out of 1 rated this helpful - Rate this topic

DTEClass Class

This class supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Microsoft Internal Use Only.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

[ClassInterfaceAttribute(0)] 
[GuidAttribute("3C9CFE1E-389F-4118-9FAD-365385190329")] 
public class DTEClass : _DTE, DTE
/** @attribute ClassInterfaceAttribute(0) */ 
/** @attribute GuidAttribute("3C9CFE1E-389F-4118-9FAD-365385190329") */ 
public class DTEClass implements _DTE, DTE
ClassInterfaceAttribute(0) 
GuidAttribute("3C9CFE1E-389F-4118-9FAD-365385190329") 
public class DTEClass implements _DTE, DTE

Refer to _DTE for this functionality. Do not instantiate from this class.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Creating new instances of Visual Studio

Programatically creating new instances of Visual Studio is possible. In Visual Studio .NET 2002 the line of code

    DTE dteObject = new DTE();

could be used to instantiate a new version of VS 2002. For side by side reasons, this functionality was removed, and now you need to use a different method to create a new instance. This code looks like:

  System.Type t = System.Type.GetTypeFromProgID("VisualStudio.DTE.8.0");

  object obj = System.Activator.CreateInstance(t, true);

  EnvDTE.DTE dteObject = (EnvDTE.DTE)obj;

 

If you use the code to new an instance of DTE, then one of two outcomes will result. Either you will instantiate an instance of Visual Studio .NET 2002 (if it is installed on that computer), or an exception will be thrown (if VS 2002 is not installed on that computer). Using the System.Type.GetTypeFromProgID method is always better because it is guaranteed to work, it allows you to specify a specific version of Visual Studio to run (like above, where the specific version is given) or you can specify a version independant ProgID, such as VisualStudio.DTE, and create any version of Visual Studio that may be installed.

Advertisement