共用方式為


VCProjectEngine.LoadProject 方法

載入專案。

命名空間:  Microsoft.VisualStudio.VCProjectEngine
組件:  Microsoft.VisualStudio.VCProjectEngine (在 Microsoft.VisualStudio.VCProjectEngine.dll 中)

語法

'宣告
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

參數

傳回值

型別:System.Object
VCProject 物件。

範例

請參閱HOW TO:編譯專案模型擴充性的範例程式碼如需有關如何編譯及執行這個範例資訊。

無法從指令碼呼叫這個方法。 必須從建立專案引擎的新執行個體的應用程式呼叫它。

' 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 安全性

請參閱

參考

VCProjectEngine 介面

Microsoft.VisualStudio.VCProjectEngine 命名空間