Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToolManifestFinder detect .slnx #47512

Merged
merged 5 commits into from
Mar 13, 2025
Merged
Changes from all commits
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
4 changes: 2 additions & 2 deletions src/Cli/dotnet/ToolManifest/ToolManifestFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public FilePath FindFirst(bool createIfNotFound = false)
/*
The --create-manifest-if-needed will use the following priority to choose the folder where the tool manifest goes:
1. Walk up the directory tree searching for one that has a.git subfolder
2. Walk up the directory tree searching for one that has a .sln/git file in it
2. Walk up the directory tree searching for one that has a .sln(x)/git file in it
3. Use the current working directory
*/
private DirectoryPath GetDirectoryToCreateToolManifest()
Expand All @@ -214,7 +214,7 @@ private DirectoryPath GetDirectoryToCreateToolManifest()
if (currentSearchDirectory.Value.Value != null)
{
if (_fileSystem.Directory.EnumerateFiles(currentSearchDirectory.Value.Value)
.Any(filename => Path.GetExtension(filename).Equals(".sln", StringComparison.OrdinalIgnoreCase))
.Any(filename => Path.GetExtension(filename).Equals(".sln", StringComparison.OrdinalIgnoreCase) || Path.GetExtension(filename).Equals(".slnx", StringComparison.OrdinalIgnoreCase))
|| _fileSystem.File.Exists(currentSearchDirectory.Value.WithFile(".git").Value))

{
Expand Down