Solution3.DTE Property

Definition

Gets the top-level extensibility object.

C++/CX
public:
 property EnvDTE::DTE ^ DTE { EnvDTE::DTE ^ get(); };

Property Value

DTE

A DTE object.

Implements

DTE
Attributes

Examples

VB
Sub Solution3Example(ByVal dte As DTE2)  
    ' This function creates a solution and adds a Visual C# Console  
    ' project to it.  
    Try  
        Dim soln As Solution3 = CType(DTE.Solution, Solution3)  
        Dim csTemplatePath As String  
        ' This path must exist on your computer.  
        ' Replace <file path> below with an actual path.  
        Dim csPrjPath As String = "<file path>"  
        MsgBox("starting")  
        ' Get the project template path for a C# console project.  
        csTemplatePath = CType(soln.GetProjectTemplate _  
        ("ConsoleApplication.zip", "CSharp"), string)  
        ' Create a new C# Console project using the template obtained   
        ' above.  
        soln.AddFromTemplate(csTemplatePath, csPrjPath, _  
        "New CSharp Console Project", False)  
        MsgBox("done")  
    Catch ex As System.Exception  
        MsgBox(ex.ToString)  
    End Try  
End Sub  

Remarks

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

Applies to

Produkt Verzie
Visual Studio SDK 2015, 2017, 2019, 2022