-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Generate RegisterProvider metadata at build time via source generator #9731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com>
- Add RegisteredProviders dictionary to TypeManifestOptions - Add RegisterProviderAttribute to LibraryTypes - Extend MetadataModel to track registered providers - Update CodeGenerator to discover RegisterProviderAttribute on assemblies - Update MetadataGenerator to emit provider registration code - Update DefaultClientServices to use generated metadata - Update DefaultSiloServices to use generated metadata Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com>
Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com>
…te duplication Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com>
|
@copilot looks like there's an error: [2025-10-27 16:03:32] [build-stdout] /home/runner/work/orleans/orleans/src/Orleans.CodeGenerator/MetadataGenerator.cs(118,50): error CS1503: Argument 1: cannot convert from 'Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax>' to 'Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax>' [/home/runner/work/orleans/orleans/src/Orleans.CodeGenerator/Orleans.CodeGenerator.csproj]**** |
Changed from ExpressionSyntax[] to ArgumentSyntax[] and wrapped each expression in Argument() to match Roslyn API requirements for TupleExpression. This fixes the CS1503 compilation error. Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com>
Fixed in cba5aae. The issue was using |
|
@copilot the PR doesn't build |
I'm unable to reproduce the build failure locally due to network restrictions. Could you share the specific error message from the build log? This will help me identify and fix the issue. 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
Summary
This PR implements source generation for
RegisterProviderAttributeto eliminate runtime assembly scanning, improving startup performance.Changes
How It Works
Before: At runtime, DefaultClientServices and DefaultSiloServices scanned all assemblies for RegisterProviderAttribute, which was expensive.
After:
Benefits
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Microsoft Reviewers: Open in CodeFlow