Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Cli/dotnet/commands/dotnet-sln/add/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ private async Task AddProjectsToSolutionAsync(string solutionFileFullPath, IEnum
string relativePath = Path.GetRelativePath(Path.GetDirectoryName(solutionFileFullPath), projectPath);
// Add fallback solution folder
string relativeSolutionFolder = Path.GetDirectoryName(relativePath);
// Don't add solution folder if it contains ..
if (relativeSolutionFolder.Contains(".."))
{
relativeSolutionFolder = string.Empty;
}

if (!_inRoot && solutionFolder is null && !string.IsNullOrEmpty(relativeSolutionFolder))
{
if (relativeSolutionFolder.Split(Path.DirectorySeparatorChar).LastOrDefault() == Path.GetFileNameWithoutExtension(relativePath))
Expand Down
Loading