次の方法で共有


Solution3.AddIns Property

Definition

Caution

AddIn related extension points are no longer supported in Visual Studio.

Gets an AddIns collection, which contains all currently available add-ins associated with the solution.

public:
 property EnvDTE::AddIns ^ AddIns { EnvDTE::AddIns ^ get(); };
[System.Runtime.InteropServices.DispId(32)]
public EnvDTE.AddIns AddIns { [System.Runtime.InteropServices.DispId(32)] get; }
[System.Runtime.InteropServices.DispId(32)]
[System.Obsolete("AddIn related extension points are no longer supported in Visual Studio.")]
public EnvDTE.AddIns AddIns { [System.Runtime.InteropServices.DispId(32)] get; }
[<System.Runtime.InteropServices.DispId(32)>]
[<get: System.Runtime.InteropServices.DispId(32)>]
member this.AddIns : EnvDTE.AddIns
[<System.Runtime.InteropServices.DispId(32)>]
[<get: System.Runtime.InteropServices.DispId(32)>]
[<System.Obsolete("AddIn related extension points are no longer supported in Visual Studio.")>]
member this.AddIns : EnvDTE.AddIns
Public ReadOnly Property AddIns As AddIns

Property Value

An AddIns collection.

Implements

Attributes

Examples

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  
using System.Windows.Forms;  
public void Solution3Example(DTE2 dte)  
{  
    // This function creates a solution and adds a Visual C# Console  
    // project to it.  
    try{  
        Solution3 soln = (Solution3)_applicationObject.Solution;  
        String csTemplatePath;  
        // The file path must exist on your computer.  
        // Replace <file path> below with an actual path.  
        String csPrjPath = "<file path>";  
        "<file path>MessageBox.Show("Starting...");  
        "<file path>"<file path>csTemplatePath =   
        soln.GetProjectTemplate("ConsoleApplication.zip", "CSharp");  
        // Create a new C# Console project using the template obtained   
        // above.  
        soln.AddFromTemplate(csTemplatePath, csPrjPath,  
          "New CSharp Console Project", false);  
        MessageBox.Show("Done!");  
    }  
    catch(SystemException ex)  
    {  
        MessageBox.Show("ERROR: " + ex);  
    }  
}  

Remarks

Add-ins are deprecated. For more information, see FAQ: Converting Add-ins to VSPackage Extensions.

Applies to