Visual Studio 2010
Removes the specified project from the solution.
Assembly: EnvDTE (in EnvDTE.dll)
Sub RemoveExample() ' This function loads a solution, deletes the first project, ' and then closes the solution. Dim soln As Solution Dim proj As Project Dim msg As String 'Create a reference to the solution. soln = DTE.Solution ' Open the solution just created. soln.Open("c:\temp2\newsolution.sln") ' Delete the newly-created VB Console application project in ' this solution. MsgBox("Ready to delete the project.") proj = soln.Projects.Item(1) soln.Remove(proj) MsgBox("Project was deleted from the solution.") ' Close the solution from the IDE. soln.Close() End Sub
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.