Skip to content

Fix Install-DotNetSdk.ps1 hang from recursive Directory.Build.props search#513

Open
drognanar wants to merge 2 commits into
AArnott:mainfrom
drognanar:fix-install-dotnet-sdk-recurse
Open

Fix Install-DotNetSdk.ps1 hang from recursive Directory.Build.props search#513
drognanar wants to merge 2 commits into
AArnott:mainfrom
drognanar:fix-install-dotnet-sdk-recurse

Conversation

@drognanar
Copy link
Copy Markdown

The Get-ChildItem call applied -Recurse to all three path arguments, including Directory.Build.props. PowerShell splits this into container + leaf filter, so -Recurse causes it to search the entire repo root for every file named Directory.Build.props, crawling into large directories (bin, obj, tmp, etc.) and causing the script to hang in repos with deep directory trees.

Fix: Split the call so -Recurse only applies to the src/ and test/ project file globs. Directory.Build.props is fetched with Get-Item -LiteralPath (single file, no recursion, no wildcard interpretation).

…earch

The Get-ChildItem call applied -Recurse to all three path arguments,
including Directory.Build.props. PowerShell splits this into container
+ leaf filter, so -Recurse causes it to search the entire repo root
for every file named Directory.Build.props, crawling into large
directories (bin, obj, tmp, etc.) and causing the script to hang.

Split the call so -Recurse only applies to the src/ and test/ project
file globs. Directory.Build.props is fetched with Get-Item -LiteralPath
(single file, no recursion, no wildcard interpretation).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread tools/Install-DotNetSdk.ps1
Address review feedback: keep recursive Directory.Build.props discovery under src/ and test/, while still picking up the repo-root file. Avoids crawling top-level bin/obj/tmp directories.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@drognanar drognanar force-pushed the fix-install-dotnet-sdk-recurse branch from 348a724 to 8d14c85 Compare May 11, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants