Anteckning
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
Evaluates the value of a project model or environment macro. See Macros for Build Commands and Properties for more information about these macros.
Namespace:  Microsoft.VisualStudio.VCProjectEngine
Assembly:  Microsoft.VisualStudio.VCProjectEngine (in Microsoft.VisualStudio.VCProjectEngine.dll)
Syntax
'Declaration
Function Evaluate ( _
    In As String _
) As String
string Evaluate(
    string In
)
String^ Evaluate(
    [InAttribute] String^ In
)
abstract Evaluate : 
        In:string -> string
function Evaluate(
    In : String
) : String
Parameters
In
Type: System.StringRequired. The macro you want to expand.
Return Value
Type: System.String
A string with the expanded macro.
Remarks
If the string you want to evaluate contains no macros, then you get exactly the same string back.
Examples
See How to: Compile Example Code for Project Model Extensibility for information about how to compile and run this example.
The following example uses Evaluate in the integrated development environment (IDE):
' add reference to Microsoft.VisualStudio.VCProjectEngine.
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine
Public Module Module1
    Sub Test()
        Dim file As VCFile
        Dim col As IVCCollection
        Dim fileconfig As VCFileConfiguration
        Dim strng As String
        Dim prj As VCProject
        prj = DTE.Solution.Projects.Item(1).Object
        col = prj.Files
        file = col.Item(1)
        col = file.FileConfigurations
        fileconfig = col.Item("Debug|Win32")
        col = prj.Files
        file = col.Item(1)
        col = file.FileConfigurations
        fileconfig = col.Item("Debug|Win32")
        strng = fileconfig.Evaluate("$(TargetDir)")
    End Sub
End Module
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.