Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 16, 2025

This PR adds a .github/copilot-setup-steps.yml file to automatically preinstall the .NET 10 SDK in the GitHub Copilot Coding Agent environment.

Problem

The GitHub Copilot Coding Agent environment currently lacks the .NET 10 SDK required by this repository. When the agent attempts to build or test the project, it fails with:

A compatible .NET SDK was not found.
Requested SDK version: 10.0.100-rc.1.25451.107

This prevents the agent from effectively working with the codebase.

Solution

Following the official GitHub Copilot documentation for customizing the agent environment, this PR adds a copilot-setup-steps.yml file that:

  1. Uses actions/setup-dotnet@v5 to install the .NET SDK
  2. Leverages the existing global.json file via the global-json-file parameter
  3. Automatically installs the correct SDK version (10.0.100-rc.1.25451.107) without hardcoding it
  4. Runs dotnet --info to verify the SDK installation

Implementation

The implementation follows the recommended approach from actions/setup-dotnet:

name: Setup .NET SDK
steps:
  - uses: actions/setup-dotnet@v5
    with:
      global-json-file: global.json
  - run: dotnet --info

By referencing global.json instead of hardcoding the version, this configuration will automatically stay in sync when the SDK version is updated in the future. The semantic version tag @v5 is used for simplicity and maintainability. The dotnet --info step provides verification that the SDK was installed correctly.

Testing

  • ✅ YAML syntax validated
  • ✅ File structure follows GitHub Copilot documentation
  • ✅ Build completed successfully with .NET 10 SDK (0 errors, 0 warnings)
  • ✅ All tests passed (170 passed, 5 skipped manual tests, 0 failed)
  • ✅ Verified across all target frameworks (.NET 10.0, 9.0, 8.0, Framework 4.7.2, and Standard 2.0)

This pull request was created as a result of the following prompt from Copilot chat.

Add a copilot-setup-steps.yml file to preinstall the .NET 10 SDK in the GitHub Copilot Coding Agent environment, following the official documentation for customizing the agent environment: https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment#preinstalling-tools-or-dependencies-in-copilots-environment. Please utilize the recommended method from actions/setup-dotnet (https://github.com/actions/setup-dotnet?tab=readme-ov-file#using-the-global-json-file-input), leveraging the existing global.json file to define which .NET SDK version should be installed, rather than specifying the version directly in YAML.

Original prompt

Add a copilot-setup-steps.yml file to preinstall the .NET 10 SDK in the GitHub Copilot Coding Agent environment, following the official documentation for customizing the agent environment: https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment#preinstalling-tools-or-dependencies-in-copilots-environment. Please utilize the recommended method from actions/setup-dotnet (https://github.com/actions/setup-dotnet?tab=readme-ov-file#using-the-global-json-file-input), leveraging the existing global.json file to define which .NET SDK version should be installed, rather than specifying the version directly in YAML.

This pull request was created as a result of the following prompt from Copilot chat.

Add a copilot-setup-steps.yml file to preinstall the .NET 10 SDK in the GitHub Copilot Coding Agent environment, following the official documentation for customizing the agent environment: https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment#preinstalling-tools-or-dependencies-in-copilots-environment. Please utilize the recommended method from actions/setup-dotnet (https://github.com/actions/setup-dotnet?tab=readme-ov-file#using-the-global-json-file-input), leveraging the existing global.json file to define which .NET SDK version should be installed, rather than specifying the version directly in YAML.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Add copilot-setup-steps.yml file to preinstall .NET 10 SDK Add copilot-setup-steps.yml to preinstall .NET 10 SDK in GitHub Copilot environment Oct 16, 2025
@Copilot Copilot AI requested a review from stephentoub October 16, 2025 13:55
Copilot finished work on behalf of stephentoub October 16, 2025 13:55
Copilot finished work on behalf of stephentoub October 16, 2025 14:03
@stephentoub
Copy link
Contributor

@copilot, please build the solution.

Copy link
Contributor Author

Copilot AI commented Oct 16, 2025

@copilot, please build the solution.

Build completed successfully with .NET 10 SDK (10.0.100-rc.1.25451.107):

Build: SUCCESS - 0 errors, 0 warnings (1m 22s)
Tests: 170 passed, 5 skipped (manual tests), 0 failed (7s)

All projects compiled successfully across all target frameworks (.NET 10.0, 9.0, 8.0, Framework 4.7.2, and Standard 2.0).

@Copilot Copilot AI requested a review from stephentoub October 16, 2025 14:10
Copilot finished work on behalf of stephentoub October 16, 2025 14:10
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Copilot finished work on behalf of stephentoub October 16, 2025 14:14
@stephentoub
Copy link
Contributor

@copilot, can you add a subsequent step to the setup that will run dotnet --info?

Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
@stephentoub stephentoub marked this pull request as ready for review October 16, 2025 14:19
Copy link
Contributor Author

Copilot AI commented Oct 16, 2025

@copilot, can you add a subsequent step to the setup that will run dotnet --info?

Added dotnet --info step to verify the SDK installation. (commit b72e82b)

Copilot finished work on behalf of stephentoub October 16, 2025 14:20
@stephentoub stephentoub merged commit be4ff8f into main Oct 16, 2025
5 checks passed
@stephentoub stephentoub deleted the copilot/add-copilot-setup-steps-file branch October 16, 2025 14:23
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.

3 participants