Solution Solution Solution Solution Solution Solution Interface

Definition

Represents all projects and solution-wide properties in the integrated development environment (IDE). Use this object for functionality and refer to _Solution for documentation.

public interface class Solution : EnvDTE::_Solution
public interface class Solution : EnvDTE::_Solution
__interface Solution : EnvDTE::_Solution
[System.Runtime.InteropServices.CoClass(typeof(EnvDTE.SolutionClass))]
[System.Runtime.InteropServices.Guid("26F6CC4B-7A48-4E4D-8AF5-9E960232E05F")]
public interface Solution : EnvDTE._Solution
type Solution = interface
    interface _Solution
Public Interface Solution
Implements _Solution
Derived
Attributes
Implements

Examples

This example works only in Visual Studio .NET 2003. For more information, see Migrating Code that Creates Projects by Using Templates.

Sub SolutionExample()  
   ' This function creates a solution and adds a Visual Basic Console  
   ' project to it.   
   Dim soln As Solution  
   Dim proj As Project  
   Dim msg As String  
  
   ' Create a reference to the solution.  
   soln = DTE.Solution  
  
   ' Create a new solution.  
   soln.Create("c:\temp2", "MyNewSolution")  
  
   ' Create a new Visual Basic Console application project.  
   ' Adjust the save path as needed.  
   proj = soln.AddFromTemplate("D:\Program Files\Microsoft Visual Studio .NET\Vb7\VBWizards\ConsoleApplication\Templates\1033\ConsoleApplication.vbproj", "c:\temp2", "My New Project", True)  
   ' Save the new solution and project.  
   soln.SaveAs("c:\temp2\newsolution.sln")  
   msg = "Created new solution: " & soln.FullName & vbCrLf  
   msg = msg & "Created new project: " & proj.Name  
   MsgBox(msg)  
End Sub  

Remarks

The Solution object is a collection of all the projects in the current instance of the IDE and all solution-wide properties such as build configurations. The Solution object contains a project element for every project, whether it is a wrapped project, a subproject, or a top-level project.

Reference this object by using DTE.Solution. To refer to virtual projects, such as MiscFiles or SolutionItems, use Solution.Item(EnvDTE.Constants.vsProjectKindMisc) or Solution.Item(EnvDTE.Constants.vsProjectKindSolutionItems).

Methods

AddFromFile(String, Boolean) AddFromFile(String, Boolean) AddFromFile(String, Boolean) AddFromFile(String, Boolean) AddFromFile(String, Boolean) AddFromFile(String, Boolean)

Adds a project to the solution, based on a project file already stored in the system.

(Inherited from _Solution)

AddFromTemplate(String, String, String, Boolean) AddFromTemplate(String, String, String, Boolean) AddFromTemplate(String, String, String, Boolean) AddFromTemplate(String, String, String, Boolean) AddFromTemplate(String, String, String, Boolean) AddFromTemplate(String, String, String, Boolean)

Copies an existing project file, and any items or subdirectories it contains, to the specified location and adds it to the solution.

(Inherited from _Solution)

Close(Boolean) Close(Boolean) Close(Boolean) Close(Boolean) Close(Boolean) Close(Boolean)

Closes the current solution.

(Inherited from _Solution)

Create(String, String) Create(String, String) Create(String, String) Create(String, String) Create(String, String) Create(String, String)

Creates an empty solution in the specified directory with the specified name.

(Inherited from _Solution)

FindProjectItem(String) FindProjectItem(String) FindProjectItem(String) FindProjectItem(String) FindProjectItem(String) FindProjectItem(String)

Locates an item in a project.

(Inherited from _Solution)

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumeration for items in a collection.

(Inherited from _Solution)

Item(Object) Item(Object) Item(Object) Item(Object) Item(Object) Item(Object)

Returns a Project object in a Projects collection.

(Inherited from _Solution)

Open(String) Open(String) Open(String) Open(String) Open(String) Open(String)

Opens the solution in the specified view.

(Inherited from _Solution)

ProjectItemsTemplatePath(String) ProjectItemsTemplatePath(String) ProjectItemsTemplatePath(String) ProjectItemsTemplatePath(String) ProjectItemsTemplatePath(String) ProjectItemsTemplatePath(String)

Returns the location of project item templates for the specified project type.

(Inherited from _Solution)

Remove(Project) Remove(Project) Remove(Project) Remove(Project) Remove(Project) Remove(Project)

Removes the specified project from the solution.

(Inherited from _Solution)

SaveAs(String) SaveAs(String) SaveAs(String) SaveAs(String) SaveAs(String) SaveAs(String)

Saves the solution.

(Inherited from _Solution)

Properties

AddIns AddIns AddIns AddIns AddIns AddIns

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

(Inherited from _Solution)

Count Count Count Count Count Count

Gets a value indicating the number of objects in the collection.

(Inherited from _Solution)

DTE DTE DTE DTE DTE DTE

Gets the top-level extensibility object.

(Inherited from _Solution)

ExtenderCATID ExtenderCATID ExtenderCATID ExtenderCATID ExtenderCATID ExtenderCATID

Gets the Extender category ID (CATID) for the object.

(Inherited from _Solution)

ExtenderNames ExtenderNames ExtenderNames ExtenderNames ExtenderNames ExtenderNames

Gets a list of available Extenders for the object.

(Inherited from _Solution)

Extender[String] Extender[String] Extender[String] Extender[String] Extender[String] Extender[String]

Gets the requested Extender object if it is available for this object.

(Inherited from _Solution)

FileName FileName FileName FileName FileName FileName

Microsoft Internal Use Only.

(Inherited from _Solution)

FullName FullName FullName FullName FullName FullName

Gets the full path and name of the object's file.

(Inherited from _Solution)

Globals Globals Globals Globals Globals Globals

Gets the Globals that contains add-in values that may be saved in the solution (.sln) file, the project file, or in the user's profile data.

(Inherited from _Solution)

IsDirty IsDirty IsDirty IsDirty IsDirty IsDirty

Microsoft Internal Use Only.

(Inherited from _Solution)

IsOpen IsOpen IsOpen IsOpen IsOpen IsOpen

Determines if a solution is open.

(Inherited from _Solution)

Parent Parent Parent Parent Parent Parent

Gets the immediate parent object of a _Solution.

(Inherited from _Solution)

Projects Projects Projects Projects Projects Projects

Gets a collection of the projects currently in the solution.

(Inherited from _Solution)

Properties Properties Properties Properties Properties Properties

Gets a collection of all properties that pertain to the _Solution.

(Inherited from _Solution)

Saved Saved Saved Saved Saved Saved

Returns true if the object has not been modified since last being saved or opened.

(Inherited from _Solution)

SolutionBuild SolutionBuild SolutionBuild SolutionBuild SolutionBuild SolutionBuild

Gets the SolutionBuild object for the solution, which represents the root of the build automation model at the solution level.

(Inherited from _Solution)

TemplatePath[String] TemplatePath[String] TemplatePath[String] TemplatePath[String] TemplatePath[String] TemplatePath[String]

Gets the full path and name of the directory that contains templates for the specified type of project.

(Inherited from _Solution)

Applies to