Share via


VCProjectEngine.LoadProject-Methode

Lädt ein Projekt.

Namespace:  Microsoft.VisualStudio.VCProjectEngine
Assembly:  Microsoft.VisualStudio.VCProjectEngine (in Microsoft.VisualStudio.VCProjectEngine.dll)

Syntax

'Declaration
Function LoadProject ( _
    projectName As String _
) As Object
Object LoadProject(
    string projectName
)
Object^ LoadProject(
    [InAttribute] String^ projectName
)
abstract LoadProject : 
        projectName:string -> Object 
function LoadProject(
    projectName : String
) : Object

Parameter

Rückgabewert

Typ: System.Object
Ein VCProject-Objekt.

Beispiele

Weitere Informationen finden Sie unter Gewusst wie: Kompilieren von Beispielcode für die Erweiterbarkeit von Projektmodellen Informationen zum Ändern dieses Beispiel kompiliert und ausgeführt wird.

Diese Methode kann nicht vom HTML-Skript aufgerufen werden.Es muss von einer Anwendung aufgerufen werden, die eine neue Instanz des Projekts moduls erstellt.

' compile with /reference:Microsoft.VisualStudio.VCProjectEngine.dll
Option Strict Off
Imports Microsoft.VisualStudio.VCProjectEngine

Module Module1
Sub Main()
Dim Engine As VCProjectEngine
Dim Proj As VCProject
Dim Configs, Tools As IVCCollection
Dim Config As VCConfiguration
Dim LinkerTool As VCLinkerTool

Engine = New VCProjectEngineObject()
Proj = Engine.LoadProject("xx.vcxproj")

Configs = Proj.Configurations
Config = Configs.Item(1)
Tools = Config.Tools

LinkerTool = Tools.Item("VCLinkerTool")
System.Console.WriteLine("Current value of ToolName: {0}", LinkerTool.ToolName)
Engine.RemoveProject("xx.vcxproj")
End Sub
End Module

.NET Framework-Sicherheit

Siehe auch

Referenz

VCProjectEngine Schnittstelle

Microsoft.VisualStudio.VCProjectEngine-Namespace