VCProjectEngineObjectClass.LoadProject 方法

加载项目。

命名空间:  Microsoft.VisualStudio.VCProjectEngine
程序集:  Microsoft.VisualStudio.VCProjectEngine(在 Microsoft.VisualStudio.VCProjectEngine.dll 中)

语法

声明
Public Overridable Function LoadProject ( _
    projectName As String _
) As Object
public virtual Object LoadProject(
    string projectName
)
public:
virtual Object^ LoadProject(
    [InAttribute] String^ projectName
)
abstract LoadProject : 
        projectName:string -> Object 
override LoadProject : 
        projectName:string -> Object 
public function LoadProject(
    projectName : String
) : Object

参数

返回值

类型:System.Object
一个 VCProject 对象。

实现

VCProjectEngine.LoadProject(String)

备注

不要实例化 VCProjectEngineObjectClass。实例化 VCProjectEngineObject ,如下所示:

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

.NET Framework 安全性

请参见

参考

VCProjectEngineObjectClass 类

Microsoft.VisualStudio.VCProjectEngine 命名空间