Adds a project to the solution, based on a project file already stored in the system.
Assembly: EnvDTE (in EnvDTE.dll)
- Type: System.String
Required. The full path and file name of the project file.
- Type: System.Boolean
Optional. Indicates whether the project loads in the current solution or its own; true if the current solution is closed and the project is added to a new solution, false if the project is added to the existing open solution.
Sub AddFromFileExample() ' This function creates a solution and adds a Visual Basic Console ' project to it. Dim soln As Solution ' Create a reference to the solution. soln = DTE.Solution ' Create a new solution. soln.Create("c:\temp2", "MyNewSolution") ' Add an existing project to the new solution. soln.AddFromFile("c:\temp\SomeProj.vbproj") 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.