Partager via


_Solution.AddFromFile, méthode

Ajoute à la solution un projet basé sur un fichier projet déjà stocké dans le système.

Espace de noms :  EnvDTE
Assembly :  EnvDTE (dans EnvDTE.dll)

Syntaxe

'Déclaration
Function AddFromFile ( _
    FileName As String, _
    Exclusive As Boolean _
) As Project
Project AddFromFile(
    string FileName,
    bool Exclusive
)
Project^ AddFromFile(
    [InAttribute] String^ FileName, 
    [InAttribute] bool Exclusive
)
abstract AddFromFile : 
        FileName:string * 
        Exclusive:bool -> Project 
function AddFromFile(
    FileName : String, 
    Exclusive : boolean
) : Project

Paramètres

  • FileName
    Type : System.String
    Obligatoire.Chemin d'accès complet et nom de fichier du fichier projet.
  • Exclusive
    Type : System.Boolean
    Facultatif.Indique si le projet se charge dans la solution en cours ou dans sa propre solution ; true si la solution en cours est fermée et que le projet est ajouté à une nouvelle solution, false si le projet est ajouté à une solution ouverte existante.

Valeur de retour

Type : EnvDTE.Project
Objet Project.

Notes

Vous pouvez utiliser la méthode LaunchWizard plutôt que AddFromFile pour exécuter un Assistant si vous souhaitez supprimer son interface utilisateur pendant l'exécution. LaunchWizard a un paramètre qui vous permet de désactiver l'interface utilisateur.

Exemples

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

Sécurité .NET Framework

Voir aussi

Référence

_Solution Interface

EnvDTE, espace de noms