Skip to content

Commit

Permalink
Convert paths to full paths when creating solution & project objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichielOda committed Mar 7, 2024
1 parent 47251c3 commit 95aa14e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Parsers.Common/VisualStudio/Projects/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ public static Project Load(string path, string projectName)
throw new FileNotFoundException("Could not find project file: " + path);
}

// Make sure to use the full path
path = FileSystem.Path.GetFullPath(path);

try
{
string projectDir = FileSystem.Path.GetDirectoryName(path);
Expand Down
5 changes: 4 additions & 1 deletion Parsers.Common/VisualStudio/Solution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ protected Solution(string path)
throw new FileNotFoundException("Could not find the specified solution file '" + path + "'.");
}

// Make sure to use the full path
path = _fileSystem.Path.GetFullPath(path);

SolutionPath = path;
SolutionDirectory = _fileSystem.Path.GetDirectoryName(path);

Expand Down Expand Up @@ -88,7 +91,7 @@ public static Solution Load(string solutionPath, ILogCollector logCollector = nu
}

/// <summary>
/// Loads the a project of the solution.
/// Loads the project of the solution.
/// </summary>
/// <param name="projectInSolution">The project of the solution.</param>
/// <returns>The loaded project.</returns>
Expand Down
2 changes: 1 addition & 1 deletion Parsers.Common/VisualStudio/SolutionItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected SolutionItem(Solution solution, Guid guid, string name, string path)
/// Gets the absolute path of the item.
/// </summary>
/// <value>The absolute path of the item.</value>
public string AbsolutePath => _fileSystem.Path.Combine(Solution.SolutionDirectory, RelativePath);
public string AbsolutePath => _fileSystem.Path.GetFullPath(_fileSystem.Path.Combine(Solution.SolutionDirectory, RelativePath));

/// <summary>
/// Gets the parent item.
Expand Down

0 comments on commit 95aa14e

Please sign in to comment.