Project.Delete Method

Definition

Removes the project from the current solution.

Note that this method is not currently implemented.

C++/CX
public:
 void Delete();
Attributes

Examples

VB
Public Sub CodeExample(ByVal dte As DTE2)   
    Try  
        ' Open a project before running this sample.  
        Dim prj As Project = dte.Solution.Projects.Item(1)  
        Dim prjs As Projects  

        Dim del As DialogResult  
        del = MessageBox.Show("Delete project from solution?", "Delete Method", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)  
        If del = DialogResult.Yes Then  
            prj.Delete()  
        End If  
        del = MessageBox.Show("Save project as another filename?", "SaveAs Method", MessageBoxButtons.YesNo)  
        If del = DialogResult.Yes Then  
            prj.SaveAs(Interaction.InputBox("Save this project with new name: ", "SaveAs Method", "MyProjectWithNewName", 300, 300))  
        End If  
    Catch ex As Exception  
        MessageBox.Show(ex.Message)  
    End Try  
End Sub  

Applies to

Proizvod Verzije
Visual Studio SDK 2015, 2017, 2019, 2022