Table of Contents

Class DotnetFileUtil

Namespace
Invex.Atom.Module.Dotnet.Util
Assembly
Invex.Atom.Module.Dotnet.dll
public static class DotnetFileUtil
Inheritance
object
DotnetFileUtil

Methods

GetProjectFilePathByName(IRootedFileSystem, string)

Gets the full path to a project file by its name.

public static RootedPath? GetProjectFilePathByName(IRootedFileSystem fileSystem, string projectName)

Parameters

fileSystem IRootedFileSystem

The file system to use.

projectName string

The name of the project.

Returns

RootedPath

The full path to the project file.

Remarks

Searches for a file matching the pattern {projectName}.*proj in all subdirectories of the root directory. If multiple files match, the one with the shortest path ancestry (fewest directory levels) is returned.

Exceptions

InvalidOperationException

Thrown if the project file does not exist.

GetPropertyFilesForProject(RootedPath, RootedPath)

Finds the Directory.Build.props files that apply to the given project file.

public static IEnumerable<RootedPath> GetPropertyFilesForProject(RootedPath projectFilePath, RootedPath rootPath)

Parameters

projectFilePath RootedPath

The full path to the project file.

rootPath RootedPath

The root path for the operation. Directories above this path will not be searched.

Returns

IEnumerable<RootedPath>

The project file as well as any Directory.Build.props files that apply to it.