Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 6, 2025

Problem

The copilot-setup workflow was failing with the following error:

Run dotnet restore
MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.
Error: Process completed with exit code 1.

Root Cause

The dotnet restore and dotnet build commands 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:

  1. .github/actions/setup-dotnet/action.yml - Modified the composite action to specify EssentialCSharp.sln:

    • dotnet restoredotnet restore EssentialCSharp.sln
    • dotnet build --no-restoredotnet build EssentialCSharp.sln --no-restore
  2. .github/workflows/LocalesTest.yml - Applied the same fix for consistency:

    • dotnet restoredotnet restore EssentialCSharp.sln
    • dotnet build --no-restoredotnet build EssentialCSharp.sln --no-restore

Testing

Verified the fix locally by running:

  • dotnet restore EssentialCSharp.sln - Completed successfully
  • dotnet build EssentialCSharp.sln --no-restore - Completed successfully with 114 warnings, 0 errors
  • dotnet test --no-build --no-restore --verbosity normal - Tests ran successfully

This 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
    • Triggering command: /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)
    • Triggering command: /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)
    • Triggering command: /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
    • Triggering command: /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)
    • Triggering command: /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)
    • Triggering command: /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

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/setup-dotnet@v5
(node:2171) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
/home/runner/work/_actions/actions/setup-dotnet/v5/externals/install-dotnet.sh --skip-non-versioned-files --runtime dotnet --channel LTS
dotnet-install: .NET Core Runtime with version '8.0.20' is already installed.
/home/runner/work/_actions/actions/setup-dotnet/v5/externals/install-dotnet.sh --skip-non-versioned-files --channel 8.0
dotnet-install: .NET Core SDK with version '8.0.414' is already installed.
/home/runner/work/_actions/actions/setup-dotnet/v5/externals/install-dotnet.sh --skip-non-versioned-files --runtime dotnet --channel LTS
dotnet-install: .NET Core Runtime with version '8.0.20' is already installed.
/home/runner/work/_actions/actions/setup-dotnet/v5/externals/install-dotnet.sh --skip-non-versioned-files --channel 9.0
dotnet-install: .NET Core SDK with version '9.0.305' is already installed.
Run dotnet restore
MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.
Error: Process completed with exit code 1.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

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
@BenjaminMichaelis BenjaminMichaelis marked this pull request as ready for review October 6, 2025 18:47
Copilot AI review requested due to automatic review settings October 6, 2025 18:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@BenjaminMichaelis BenjaminMichaelis merged commit d42f60b into v12.0 Oct 6, 2025
6 checks passed
@BenjaminMichaelis BenjaminMichaelis deleted the copilot/fix-bef413d8-4e13-49ee-a502-a19efe5a92ad branch October 6, 2025 18:52
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