Fix copilot-setup workflow by explicitly specifying solution file in dotnet commands#837
Merged
BenjaminMichaelis merged 2 commits intov12.0from Oct 6, 2025
Conversation
Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Copilot
AI
changed the title
our copilot-setup workflow failed with this:
Prepare all required actions
Getting action download info
Download action repository 'actions/setup-dotnet@v5' (SHA:d4c94342e560b34958eacfc5d055d21461ed1c5d)
Run ./.github/actions/setup-dotnet
Run actions/s...
Fix copilot-setup workflow by explicitly specifying solution file in dotnet commands
Oct 6, 2025
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the copilot-setup workflow by explicitly specifying the solution file in dotnet commands to resolve MSBuild ambiguity errors.
- Updated dotnet restore and build commands to explicitly reference
EssentialCSharp.sln - Applied the fix consistently across both the composite action and workflow files
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/actions/setup-dotnet/action.yml | Added explicit solution file specification to dotnet restore and build commands |
| .github/workflows/LocalesTest.yml | Applied same solution file specification for consistency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
copilot-setupworkflow was failing with the following error:Root Cause
The
dotnet restoreanddotnet buildcommands in the GitHub Actions workflows were not explicitly specifying which solution file to use. While the repository root contains only one solution file (EssentialCSharp.sln), MSBuild in certain environments—particularly with newer .NET SDK versions or specific GitHub Actions runner configurations—requires an explicit solution/project file specification to avoid ambiguity.Solution
Updated both affected workflow files to explicitly specify the solution file:
.github/actions/setup-dotnet/action.yml- Modified the composite action to specifyEssentialCSharp.sln:dotnet restore→dotnet restore EssentialCSharp.slndotnet build --no-restore→dotnet build EssentialCSharp.sln --no-restore.github/workflows/LocalesTest.yml- Applied the same fix for consistency:dotnet restore→dotnet restore EssentialCSharp.slndotnet build --no-restore→dotnet build EssentialCSharp.sln --no-restoreTesting
Verified the fix locally by running:
dotnet restore EssentialCSharp.sln- Completed successfullydotnet build EssentialCSharp.sln --no-restore- Completed successfully with 114 warnings, 0 errorsdotnet test --no-build --no-restore --verbosity normal- Tests ran successfullyThis is a best practice that makes the workflows more explicit and robust across different environments and .NET SDK versions.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
google.com/usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net8.0/Chapter05.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net8.0/Chapter05.Tests.deps.json /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net8.0/testhost.dll --port 37959 --endpoint 127.0.0.1:037959 --role client --parentprocessid 6060 --telemetryoptedin false(dns block)/usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net7.0/Chapter05.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net7.0/Chapter05.Tests.deps.json /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net7.0/testhost.dll --port 37433 --endpoint 127.0.0.1:037433 --role client --parentprocessid 6096 --telemetryoptedin false(dns block)/usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net6.0/Chapter05.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net6.0/Chapter05.Tests.deps.json /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net6.0/testhost.dll --port 38517 --endpoint 127.0.0.1:038517 --role client --parentprocessid 6132 --telemetryoptedin false(dns block)intellitect.com/usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net8.0/Chapter05.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net8.0/Chapter05.Tests.deps.json /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net8.0/testhost.dll --port 37959 --endpoint 127.0.0.1:037959 --role client --parentprocessid 6060 --telemetryoptedin false(dns block)/usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net7.0/Chapter05.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net7.0/Chapter05.Tests.deps.json /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net7.0/testhost.dll --port 37433 --endpoint 127.0.0.1:037433 --role client --parentprocessid 6096 --telemetryoptedin false(dns block)/usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net6.0/Chapter05.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net6.0/Chapter05.Tests.deps.json /home/REDACTED/work/EssentialCSharp/EssentialCSharp/src/Chapter05.Tests/bin/Debug/net6.0/testhost.dll --port 38517 --endpoint 127.0.0.1:038517 --role client --parentprocessid 6132 --telemetryoptedin false(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.