Export (0) Print
Expand All

VCProjectEngineObjectClass.LoadProject Method

Loads a project.

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

public virtual Object LoadProject(
	string projectName
)

Parameters

projectName
Type: System.String

Required. The project name.

Return Value

Type: System.Object
A VCProject object.

Implements

VCProjectEngine.LoadProject(String)

Do not instantiate VCProjectEngineObjectClass. Instantiate VCProjectEngineObject instead, as shown below:

Dim Engine As VCProjectEngine
Engine = New VCProjectEngineObject()

' 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.vcproj")

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.vcproj")
End Sub
End Module

Show:
© 2014 Microsoft