Open sandboxFocus

Method LoadAsync

LoadAsync(params string[])

Asynchronously loads a set of projects of solutions into a Workspace, or returns an existing workspace if the method has been previously called with the exact same parameters.

Declaration
public Task<Workspace> LoadAsync(params string[] paths)
Parameters
Type Name Description
string[] paths

A list of project or solution paths.

Returns
Type Description
Task<Workspace>

A Workspace where all specified project or solutions, and their dependencies, have been loaded.

LoadAsync(ImmutableArray<string>, ImmutableDictionary<string, string>?, bool, CancellationToken)

Asynchronously loads a set of projects of solutions into a Workspace, or returns an existing workspace if the method has been previously called with the exact same parameters. This overload allows to specify MSBuild properties.

Declaration
public Task<Workspace> LoadAsync(ImmutableArray<string> paths, ImmutableDictionary<string, string>? properties = null, bool restore = true, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ImmutableArray<string> paths

A list of project or solution paths.

ImmutableDictionary<string, string> properties
bool restore
CancellationToken cancellationToken
Returns
Type Description
Task<Workspace>

A Workspace where all specified project or solutions, and their dependencies, have been loaded.