Class DotnetFileUtil
- Namespace
- Invex.Atom.Module.Dotnet.Util
- Assembly
- Invex.Atom.Module.Dotnet.dll
public static class DotnetFileUtil
- Inheritance
-
objectDotnetFileUtil
Methods
GetProjectFilePathByName(IRootedFileSystem, string)
Gets the full path to a project file by its name.
public static RootedPath? GetProjectFilePathByName(IRootedFileSystem fileSystem, string projectName)
Parameters
fileSystemIRootedFileSystemThe file system to use.
projectNamestringThe 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
projectFilePathRootedPathThe full path to the project file.
rootPathRootedPathThe 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.