VCProjectEngine.LoadProject - метод
Loads a project.
Пространство имен: Microsoft.VisualStudio.VCProjectEngine
Сборка: Microsoft.VisualStudio.VCProjectEngine (в Microsoft.VisualStudio.VCProjectEngine.dll)
Синтаксис
'Декларация
Function LoadProject ( _
projectName As String _
) As Object
'Применение
Dim instance As VCProjectEngine
Dim projectName As String
Dim returnValue As Object
returnValue = instance.LoadProject(projectName)
Object LoadProject(
string projectName
)
Object^ LoadProject(
[InAttribute] String^ projectName
)
function LoadProject(
projectName : String
) : Object
Параметры
projectName
Тип: System.StringRequired. The project name.
Возвращаемое значение
Тип: System.Object
A VCProject object.
Примеры
See How to: Compile Example Code for Project Model Extensibility for information about how to compile and run this example.
This method cannot be called from script. It must be called from an application that creates a new instance of the project engine.
' 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
Разрешения
- Полное доверие для непосредственно вызывающего метода. Этот член не может быть использован частично доверенным кодом. Дополнительные сведения см. в разделе Using Libraries from Partially Trusted Code.