Skip to content

Include known providers in error message when provider is not found#9733

Merged
ReubenBond merged 5 commits into
mainfrom
copilot/include-known-providers-error-message
Feb 17, 2026
Merged

Include known providers in error message when provider is not found#9733
ReubenBond merged 5 commits into
mainfrom
copilot/include-known-providers-error-message

Conversation

Copilot AI commented Oct 27, 2025

Copy link
Copy Markdown
Contributor
  • Understand the issue and explore the repository structure
  • Update DefaultClientServices.cs error message to include known providers for the specified kind
  • Update DefaultSiloServices.cs error message to include known providers for the specified kind
  • Create tests to verify the enhanced error messages
  • Fix missing 'or' in DefaultClientServices.cs error message (pre-existing bug)
  • Fix using statement ordering in DefaultClientServices.cs to comply with .editorconfig
  • Fix test file build errors - use ConfigureAppConfiguration pattern and correct extension methods
  • Request code review - passed with no issues
  • Run security scanning - no vulnerabilities found

Summary

This PR successfully implements the requested feature to include known/registered providers in error messages when a provider is not found.

Key Changes:

  1. Enhanced error messages in both DefaultClientServices.cs and DefaultSiloServices.cs
  2. Error messages now include a sorted, comma-separated list of known providers for the requested kind
  3. Fixed a pre-existing typo in DefaultClientServices.cs where "or" was missing
  4. Fixed using statement ordering to comply with .editorconfig
  5. Added comprehensive tests in ProviderErrorMessageTests.cs

Example Output:

Could not find Clustering provider named 'NonExistentProvider'. This can indicate that either the 'Microsoft.Orleans.Sdk' or the provider's package are not referenced by your application. Known Clustering providers: AzureStorage, Default, DynamoDB.
Original prompt

This section details on the original issue you should resolve

<issue_title>Include known providers in error message when a provider is not found</issue_title>
<issue_description>We should update these error messages to include the list of known/registered providers for the specified kind (eg, Clustering, GrainStorage, etc)

throw new InvalidOperationException($"Could not find {kind} provider named '{name}'. This can indicate that either the 'Microsoft.Orleans.Sdk' package the provider's package are not referenced by your application.");

throw new InvalidOperationException($"Could not find {kind} provider named '{name}'. This can indicate that either the 'Microsoft.Orleans.Sdk' or the provider's package are not referenced by your application.");
</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Microsoft Reviewers: Open in CodeFlow

Copilot AI changed the title [WIP] Update error messages to include known providers Include known providers in error message when provider is not found Oct 27, 2025
Copilot AI requested a review from ReubenBond October 27, 2025 16:10
@ReubenBond

Copy link
Copy Markdown
Member

@copilot the build failed

Copilot AI commented Oct 31, 2025

Copy link
Copy Markdown
Contributor Author

@copilot the build failed

Fixed using statement ordering to comply with .editorconfig (System.* namespaces first, then alphabetically sorted). See commit cd40fc7.

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:

  • 0t3vsblobprodcus362.vsblob.vsassets.io
    • Triggering command: dotnet build src/Orleans.Core/Orleans.Core.csproj (dns block)
  • ckzvsblobprodcus347.vsblob.vsassets.io
    • Triggering command: dotnet build src/Orleans.Core/Orleans.Core.csproj (dns block)
  • dnceng.pkgs.visualstudio.com
    • Triggering command: dotnet build src/Orleans.Core/Orleans.Core.csproj (dns block)
  • frdvsblobprodcus327.vsblob.vsassets.io
    • Triggering command: dotnet build src/Orleans.Core/Orleans.Core.csproj (dns block)
  • imzvsblobprodcus368.vsblob.vsassets.io
    • Triggering command: dotnet build src/Orleans.Core/Orleans.Core.csproj (dns block)
  • kh4vsblobprodcus325.vsblob.vsassets.io
    • Triggering command: dotnet build src/Orleans.Core/Orleans.Core.csproj (dns block)
  • lylvsblobprodcus31.vsblob.vsassets.io
    • Triggering command: dotnet build src/Orleans.Core/Orleans.Core.csproj (dns block)
  • yluvsblobprodcus367.vsblob.vsassets.io
    • Triggering command: dotnet build src/Orleans.Core/Orleans.Core.csproj (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@ReubenBond ReubenBond left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Look at the build errors

@ReubenBond ReubenBond force-pushed the copilot/include-known-providers-error-message branch from cd40fc7 to bb73026 Compare November 25, 2025 03:30

Copilot AI commented Nov 25, 2025

Copy link
Copy Markdown
Contributor Author

Look at the build errors

Fixed the build errors in ProviderErrorMessageTests.cs. The issues were:

  1. Using AddConfiguration() on IConfiguration instead of using ConfigureAppConfiguration() on the host builder
  2. Using parameterless UseOrleans()/UseOrleansClient() which aren't available on IHostBuilder
  3. Missing #nullable enable directive for nullable reference types

See commit 221f423.

Copilot AI requested a review from ReubenBond November 25, 2025 03:43
@ReubenBond ReubenBond force-pushed the copilot/include-known-providers-error-message branch from 221f423 to f287cd2 Compare February 15, 2026 14:28
@ReubenBond ReubenBond marked this pull request as ready for review February 15, 2026 14:29
Copilot AI review requested due to automatic review settings February 15, 2026 14:29
@ReubenBond ReubenBond enabled auto-merge February 15, 2026 14:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 enhances error messages when providers are not found to include a list of known/registered providers of the same kind, making it easier for developers to diagnose configuration issues.

Changes:

  • Enhanced error messages in both DefaultClientServices.cs and DefaultSiloServices.cs to include sorted lists of known providers when a provider is not found
  • Fixed a pre-existing typo where "or" was missing in the DefaultClientServices.cs error message
  • Fixed using statement ordering in DefaultClientServices.cs to comply with .editorconfig rules
  • Added comprehensive tests in ProviderErrorMessageTests.cs to verify the enhanced error messages

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/Orleans.Core/Core/DefaultClientServices.cs Enhanced error messages to include known providers list, fixed typo ("or" was missing), and corrected using statement ordering
src/Orleans.Runtime/Hosting/DefaultSiloServices.cs Enhanced error messages to include known providers list (consistent with client implementation)
test/NonSilo.Tests/ProviderErrorMessageTests.cs Added comprehensive tests for client and silo provider error messages, covering different provider types

@ReubenBond ReubenBond added this pull request to the merge queue Feb 15, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Feb 15, 2026
Copilot AI and others added 5 commits February 16, 2026 14:50
Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com>
Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com>
Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com>
Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com>
…tterns

Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com>
@ReubenBond ReubenBond force-pushed the copilot/include-known-providers-error-message branch from f287cd2 to 814a9fb Compare February 16, 2026 22:50
@ReubenBond ReubenBond enabled auto-merge February 16, 2026 22:50
@ReubenBond ReubenBond added this pull request to the merge queue Feb 17, 2026
Merged via the queue into main with commit 6e535e2 Feb 17, 2026
112 of 113 checks passed
@ReubenBond ReubenBond deleted the copilot/include-known-providers-error-message branch February 17, 2026 02:05
rkargMsft pushed a commit to rkargMsft/orleans that referenced this pull request Feb 27, 2026
…otnet#9733)

* Include known providers in error message when provider is not found

Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com>

* Add tests for provider error message enhancement

Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com>

* Fix missing 'or' in error message and update tests

Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com>

* Fix using statement ordering per .editorconfig

Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com>

* Fix test file build errors - use correct configuration and hosting patterns

Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include known providers in error message when a provider is not found

3 participants