ProjectParserExtensions.

GetDotNetCliToolReference(CustomProjectParserResult, string) Method

Summary

Gets a project DotNetCliToolReference

Syntax

public static DotNetCliToolReference GetDotNetCliToolReference(this CustomProjectParserResult projectParserResult, string cliToolReferenceName)

Examples

Get the XUnit Cli tool reference
CustomParseProjectResult project 
        = ParseProject(new FilePath("test.csproj"), configuration: "Release", platform: "x86");

DotNetCliToolReference ref = project.GetDotNetCliToolReference("dotnet-xunit");
string xUnitVersion = ref.Version;

Parameters

Name Type Description
projectParserResult CustomProjectParserResult the parsed project
cliToolReferenceName string the package name

Return Value

Type Description
DotNetCliToolReference The dotnet cli tool reference if found