VCProjectReference.Reference 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
显示与此配置关联的引用。
public:
property System::Object ^ Reference { System::Object ^ get(); };
public:
property Platform::Object ^ Reference { Platform::Object ^ get(); };
[System.Runtime.InteropServices.DispId(2015)]
public object Reference { [System.Runtime.InteropServices.DispId(2015)] get; }
[<System.Runtime.InteropServices.DispId(2015)>]
[<get: System.Runtime.InteropServices.DispId(2015)>]
member this.Reference : obj
Public ReadOnly Property Reference As Object
属性值
表示与此配置关联引用的对象。
实现
- 属性
示例
有关如何编译和运行此示例的信息,请参阅 如何:编译项目模型扩展性的示例代码 。
' Add a reference to Microsoft.VisualStudio.VCProjectEngine.
' This sample displays the path of each reference in a Visual C++
' project. Therefore, make sure you have a Visual C++ project loaded
' before running this code.
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine
Public Module Module3
Sub Test()
Dim proj As Project
Dim vcproj As VCProject
Dim ref As VCReference
Dim vsref As VSLangProj.Reference
Dim refproj As Project
On Error Resume Next
' Loop each project in the solution
For Each proj In DTE.Solution.Projects
vcproj = Nothing
vcproj = CType(proj.Object, VCProject)
' If this is a Visual C++ project
If Not vcproj Is Nothing Then
' Loop each reference in the Visual C++ project
For Each ref In vcproj.VCReferences
vsref = Nothing
vsref = CType(ref.Reference, VSLangProj.Reference)
' If we have the Visual Studio reference
If Not vsref Is Nothing Then
MsgBox("The path for reference '" & vsref.Name _
& "' is '" & vsref.Path & "'.")
End If
Next
End If
Next
End Sub
End Module