Compartir a través de


SolutionConfiguration2.DTE Property

Definition

Gets the top-level extensibility object.

public:
 property EnvDTE::DTE ^ DTE { EnvDTE::DTE ^ get(); };
public:
 property EnvDTE::DTE ^ DTE { EnvDTE::DTE ^ get(); };
[System.Runtime.InteropServices.DispId(1)]
public EnvDTE.DTE DTE { [System.Runtime.InteropServices.DispId(1)] get; }
[<System.Runtime.InteropServices.DispId(1)>]
[<get: System.Runtime.InteropServices.DispId(1)>]
member this.DTE : EnvDTE.DTE
Public ReadOnly Property DTE As DTE

Property Value

DTE

A DTE object.

Implements

DTE
Attributes

Examples

This example displays the active project's name, obtained through the DTE object, for the first item. Open a project in the Visual Studio integrated development environment (IDE) before running this example.

Imports EnvDTE  
Imports EnvDTE80  
Sub SolutionConfigurationDTEExample(ByVal dte As DTE2)  
    Try  
        Dim builder As SolutionBuild = _  
        _applicationObject.Solution.SolutionBuild  
        Dim config As SolutionConfiguration2  
            config = CType(builder.SolutionConfigurations.Item(1) _  
        , SolutionConfiguration2)  
        MsgBox("The active solution project, obtained through the  _  
        DTE object, is: "  _  
        & config.DTE.ActiveSolutionProjects.ToString())  
    Catch ex As System.Exception  
        MsgBox(ex.ToString)  
    End Try  
End Sub  
using EnvDTE;  
using EnvDTE80;  
using System.Windows.Forms;  
public void SolutionConfigurationDTEExample(DTE2 dte)  
{  
    try  
    {  
        SolutionBuild builder =  
 _applicationObject.Solution.SolutionBuild;  
        SolutionConfiguration2 config;  
        config =  
 (SolutionConfiguration2)builder.SolutionConfigurations.Item(1);  
        MessageBox.Show("The active solution project, obtained through  
 the DTE object, is: " + config.DTE.ActiveSolutionProjects.ToString());  
    }  
    catch(SystemException ex)  
    {  
        MessageBox.Show(ex.ToString());  
    }  
}  

Remarks

In Visual Studio, the DTE object is the root of the automation model, which other object models often call "Application".

Applies to