Open sandboxFocus

Method GetProject

GetProject(string, string?)

Gets a project by name and optionally by target framework.

Declaration
public Project GetProject(string name, string? targetFramework = null)
Parameters
Type Name Description
string name

The project name (without extension).

string targetFramework

The target framework, or null to match any framework.

Returns
Type Description
Project

The matching project.

Exceptions
Type Condition
KeyNotFoundException

Thrown when no project with the specified name is found.

InvalidOperationException

Thrown when multiple projects match and no target framework is specified.