grpc/grpc-dotnet
gRPC for .NET
Healthy across the board
Permissive license, no critical CVEs, actively maintained — safe to depend on.
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
No critical CVEs, sane security posture — runnable as-is.
- ✓Last commit 1d ago
- ✓22+ active contributors
- ✓Distributed ownership (top contributor 38% of recent commits)
Show 3 more →Show less
- ✓Apache-2.0 licensed
- ✓CI configured
- ✓Tests present
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Healthy" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/grpc/grpc-dotnet)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/grpc/grpc-dotnet on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: grpc/grpc-dotnet
Generated by RepoPilot · 2026-05-10 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/grpc/grpc-dotnet shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
GO — Healthy across the board
- Last commit 1d ago
- 22+ active contributors
- Distributed ownership (top contributor 38% of recent commits)
- Apache-2.0 licensed
- CI configured
- Tests present
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live grpc/grpc-dotnet
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/grpc/grpc-dotnet.
What it runs against: a local clone of grpc/grpc-dotnet — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in grpc/grpc-dotnet | Confirms the artifact applies here, not a fork |
| 2 | License is still Apache-2.0 | Catches relicense before you depend on it |
| 3 | Default branch master exists | Catches branch renames |
| 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 5 | Last commit ≤ 31 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of grpc/grpc-dotnet. If you don't
# have one yet, run these first:
#
# git clone https://github.com/grpc/grpc-dotnet.git
# cd grpc-dotnet
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of grpc/grpc-dotnet and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "grpc/grpc-dotnet(\\.git)?\\b" \\
&& ok "origin remote is grpc/grpc-dotnet" \\
|| miss "origin remote is not grpc/grpc-dotnet (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(Apache-2\\.0)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"Apache-2\\.0\"" package.json 2>/dev/null) \\
&& ok "license is Apache-2.0" \\
|| miss "license drift — was Apache-2.0 at generation time"
# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
&& ok "default branch master exists" \\
|| miss "default branch master no longer exists"
# 4. Critical files exist
test -f "README.md" \\
&& ok "README.md" \\
|| miss "missing critical file: README.md"
test -f "Directory.Build.props" \\
&& ok "Directory.Build.props" \\
|| miss "missing critical file: Directory.Build.props"
test -f "Directory.Build.targets" \\
&& ok "Directory.Build.targets" \\
|| miss "missing critical file: Directory.Build.targets"
test -f "Directory.Packages.props" \\
&& ok "Directory.Packages.props" \\
|| miss "missing critical file: Directory.Packages.props"
test -f "build/version.props" \\
&& ok "build/version.props" \\
|| miss "missing critical file: build/version.props"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 31 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~1d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/grpc/grpc-dotnet"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
gRPC for .NET is the official, recommended implementation of gRPC for C# and .NET Core 3.0+. It provides three core NuGet packages—Grpc.AspNetCore for server-side hosting, Grpc.Net.Client for HTTP/2-based clients, and Grpc.Net.ClientFactory for dependency injection—enabling high-performance RPC communication with full ASP.NET Core integration (logging, DI, auth, authorization). Monorepo structured as .NET solution (Grpc.DotNet.slnx) containing multiple NuGet packages: Grpc.AspNetCore (server), Grpc.Net.Client (client), Grpc.Net.ClientFactory (factory pattern), plus infrastructure (build/, examples/, doc/, docfx/). Build properties centralized in Directory.Build.props, Directory.Build.targets, and Directory.Packages.props. Examples in examples/ (Aggregator, etc.) demonstrate real usage patterns.
👥Who it's for
.NET developers building microservices, distributed systems, and real-time applications who need efficient cross-service communication. Server developers use Grpc.AspNetCore; client developers and platform engineers use Grpc.Net.Client and Grpc.Net.ClientFactory for centralized client configuration.
🌱Maturity & risk
Highly mature and production-ready. Officially recommended by the gRPC project since May 2021, actively maintained with comprehensive CI/CD via GitHub Actions (.github/workflows/test.yml), extensive examples in examples/ directory, and full documentation structure (doc/ and docfx/). The original gRPC C# (Grpc.Core) is now deprecated in favor of this implementation.
Low risk for a core infrastructure library. Governed under GOVERNANCE.md and maintained by the gRPC organization. Dependencies are minimal and carefully curated via Directory.Packages.props. Main risk: breaking changes between major versions (documented in doc/versioning.md and doc/release_process.md), so pin versions in production. Monitor release_process.md for planned deprecations.
Active areas of work
Active maintenance and feature work visible via .github/workflows/test.yml running on every commit. Documentation being actively maintained in docfx/ with reference generation script (docfx/generate_reference_docs.sh). Version management and gRPC core API alignment automated via build/update_grpc_core_api_version.sh. Nightly builds published to https://grpc.jfrog.io/grpc/api/nuget/v3/grpc-nuget-dev.
🚀Get running
git clone https://github.com/grpc/grpc-dotnet.git
cd grpc-dotnet
./activate.sh # or activate.ps1 on Windows
build_and_test.sh
The activate script sets up the .NET SDK. build_and_test.sh compiles and runs the test suite. Requires .NET Core 3.0+.
Daily commands:
For development: ./build_and_test.sh (Linux/macOS) or build_and_test.ps1 (PowerShell on Windows). For examples: dotnet run in examples/Aggregator/Server or examples/Aggregator/Client after building. Tests run via standard dotnet test against the solution.
🗺️Map of the codebase
README.md— Essential entry point describing gRPC for .NET's three core NuGet packages (Grpc.AspNetCore, Grpc.Net.Client, Grpc.Net.ClientFactory) and the project's strategic position as the recommended .NET implementation.Directory.Build.props— Central MSBuild property configuration that defines build behavior, versioning, and common dependencies for all projects in the solution.Directory.Build.targets— Global MSBuild targets that standardize compilation, testing, and packaging rules across all projects.Directory.Packages.props— Centralized NuGet package version management for the entire monorepo, ensuring consistent dependency versions across all projects.build/version.props— Version definition file that controls the semantic versioning applied to all NuGet package outputs..github/workflows/test.yml— CI/CD pipeline configuration that defines automated testing, building, and validation for all commits and pull requests.doc/release_process.md— Documentation of the release workflow and procedures that contributors must follow to deploy new versions.
🛠️How to make changes
Add a New gRPC Service Implementation
- Define your service contract in a .proto file following the pattern of examples/Aggregator/Proto/*.proto (
examples/Aggregator/Proto/aggregate.proto) - Create a service class inheriting from the generated base class in Services/ directory, following the pattern of examples/Aggregator/Server/Services/AggregatorService.cs (
examples/Aggregator/Server/Services/AggregatorService.cs) - Register the service in your ASP.NET Core host Program.cs using MapGrpcService<YourService>() (
examples/Aggregator/Server/Program.cs) - Add NuGet reference to Grpc.AspNetCore in your Server.csproj (
examples/Aggregator/Server/Server.csproj)
Add a New gRPC Client
- Reference the same .proto files or generated client stubs in your client project (
examples/Aggregator/Proto/aggregate.proto) - Create a GrpcChannel using HttpClient and add it to dependency injection, following examples/Aggregator/Client/Program.cs pattern (
examples/Aggregator/Client/Program.cs) - Inject the gRPC client stub and use it to call remote services (
examples/Aggregator/Client/Client.csproj) - Add Grpc.Net.Client or Grpc.Net.ClientFactory NuGet package to your Client.csproj (
examples/Aggregator/Client/Client.csproj)
Configure gRPC with Blazor
- Define your service contract in a shared .proto file like examples/Blazor/Proto/weather.proto (
examples/Blazor/Proto/weather.proto) - Implement the service in your Blazor Server project following examples/Blazor/Server/Program.cs (
examples/Blazor/Server/Program.cs) - In your Blazor Client, create a GrpcChannel and inject it into pages like examples/Blazor/Client/Pages/FetchData.razor (
examples/Blazor/Client/Program.cs) - Configure httpClient in Blazor WebAssembly Program.cs to enable gRPC-Web communication (
examples/Blazor/Client/wwwroot/appsettings.json)
Update Package Versions and Release
- Update the version number in build/version.props according to semantic versioning (
build/version.props) - Review and update Directory.Packages.props for any dependency version changes (
Directory.Packages.props) - Follow the release process documented in doc/release_process.md to publish NuGet packages (
doc/release_process.md) - Push changes to trigger the CI/CD pipeline defined in .github/workflows/test.yml (
.github/workflows/test.yml)
🔧Why these technologies
- gRPC (Protocol Buffers + HTTP/2) — Provides high-performance, strongly-typed RPC with binary serialization and multiplexing over HTTP/2, enabling efficient client-server communication.
- ASP.NET Core — Offers integrated hosting, dependency injection, middleware, authentication, and standard .NET ecosystem integration for server-side gRPC services.
- .NET Core 3.0+ — Provides native HTTP/2 support in HttpClient and cross-platform runtime, enabling efficient gRPC client implementations.
- MSBuild / NuGet — Enables centralized package management, consistent versioning across monorepo, and standardized build processes for all projects.
- Blazor (WebAssembly & Server) — Demonstrates gRPC integration with modern .NET web frameworks, supporting both client-side and server-side Razor component scenarios.
⚖️Trade-offs already made
-
Single monorepo containing three separate NuGet packages (Grpc.AspNetCore, Grpc.Net.Client, Grpc.Net.ClientFactory)
- Why: Allows shared infrastructure, consistent versioning, and coordinated releases while maintaining logical separation of concerns.
- Consequence: Contributors must understand the entire codebase structure, but users can consume only the packages they need.
-
HTTP/2 as the only transport protocol (no HTTP/1.1 fallback in core implementation)
- Why: Maximizes performance and enables server push / multiplexing; aligns with modern infrastructure.
- Consequence: Requires .NET Core 3.0+ and modern infrastructure, limiting use cases on legacy systems.
-
Tight integration with ASP.NET Core middleware and DI systems
- Why: Reduces boilerplate, leverages existing .NET ecosystem patterns, and simplifies authentication/authorization.
- Consequence: Server-side gRPC services are strongly coupled to ASP.NET Core; users cannot run gRPC on bare sockets.
-
Examples (Aggregator, Blazor) demonstrate reference architectures rather than providing reusable libraries
- Why: Keeps the core packages lightweight and allows examples to evolve without breaking changes.
- Consequence: Users must replicate patterns from examples in their own code; no canonical framework beyond Grpc.AspNetCore.
🚫Non-goals (don't propose these)
- Does not provide gRPC code generation from .proto files (delegates to protoc compiler).
- Does not include authentication mechanisms—defers to ASP.NET Core standard auth (JWT, OAuth, etc.).
- Does not handle service discovery or load balancing (assumes external infrastructure or Kubernetes).
- Does not support non-HTTP/2 transports (e.g., gRPC over QUIC or custom protocols).
- Does not provide real-time bidirectional streaming backp
🪤Traps & gotchas
- Nightly builds from https://grpc.jfrog.io/grpc/api/nuget/v3/grpc-nuget-dev may have breaking changes—use with caution unless targeting nightly .NET. 2. Version alignment: gRPC for .NET version must match the underlying gRPC core API version (managed via build/update_grpc_core_api_version.sh)—mixing versions causes subtle RPC failures. 3. HTTP/2 requirement: all gRPC communication requires HTTP/2 support in the .NET version and hosting environment; HTTP/1.1 clients will fail. 4. Protocol Buffer compiler (protoc) must be installed separately for generating code from .proto files—not included in the repo. 5. The .NET SDK version is locked via build/get-dotnet.sh/.ps1—running with a different version may break tests.
🏗️Architecture
💡Concepts to learn
- HTTP/2 Server Push & Multiplexing — gRPC for .NET relies on HTTP/2 multiplexing to send multiple RPC streams over a single TCP connection efficiently; understanding this is critical for performance tuning and debugging connection issues
- Protocol Buffers (protobuf3) — All gRPC service contracts are defined in .proto files and compiled to C# DTOs; modifying .proto schemas requires understanding versioning and backward compatibility rules
- Async/Await Streaming — gRPC supports client-streaming, server-streaming, and bidirectional-streaming RPC patterns via IAsyncEnumerable<T>; Grpc.Net.Client heavily uses async/await patterns for non-blocking I/O
- Middleware Pipeline (ASP.NET Core) — Grpc.AspNetCore integrates gRPC as a middleware component in the ASP.NET Core request pipeline; understanding middleware ordering is essential for auth, logging, and error handling
- HttpClientFactory & Connection Pooling — Grpc.Net.ClientFactory wraps HttpClientFactory to efficiently pool HTTP/2 connections and reuse ChannelBase instances; this is critical for production scalability
- gRPC Status Codes & Metadata — gRPC uses a defined set of status codes (not HTTP status codes) for RPC errors, plus optional metadata (headers/trailers) for side-channel communication; proper error handling requires knowledge of this model
- Channel & Service Discovery — Grpc.Net.Client uses a Channel to manage connections to a gRPC service endpoint; understanding channel lifecycle, name resolution, and load balancing policies is essential for production deployments
🔗Related repos
grpc/grpc— The reference gRPC implementation in C++ and Go; gRPC for .NET implements the gRPC spec defined here and maintains API alignment via build/update_grpc_core_api_version.shgrpc/grpc-java— Companion implementation of gRPC for Java; developers building polyglot microservices use both this repo and grpc-java side-by-sidegrpc/grpc-web— Sibling project enabling gRPC communication from web browsers; examples/Aggregator may be consumed by grpc-web clientsprotocolbuffers/protobuf— Protocol Buffers is the serialization format and contract language for all gRPC services in this repo; .proto files are compiled to C# via protocdotnet/aspnetcore— Grpc.AspNetCore is built on ASP.NET Core's middleware and DI; deep integration with logging, auth, and routing subsystems
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add comprehensive interop tests for gRPC-Web browser scenarios
The repo contains a Blazor example (examples/Blazor/) and browser-server dependencies (grpc-web, google-protobuf) suggesting gRPC-Web support, but there are no visible interop tests validating browser-to-server communication. This is critical for a multi-platform gRPC implementation. Add tests that verify browser clients can successfully call .NET gRPC services and handle streaming, errors, and cancellation.
- [ ] Create new test project: test/Grpc.Net.Client.Tests/GrpcWebInteropTests.cs
- [ ] Add test cases for unary calls, client streaming, server streaming, and bidirectional streaming over gRPC-Web
- [ ] Reference existing test infrastructure in test/ directory and examples/Blazor/ setup
- [ ] Update .github/workflows/test.yml to run new interop test suite in CI
- [ ] Document test execution in CONTRIBUTING.md or doc/implementation_comparison.md
Add HTTP/3 and performance benchmarking suite
The README highlights that gRPC on .NET Core uses 'new HTTP/2 functionality' but there's no evidence of HTTP/3 support testing or performance benchmarks despite HTTP/3 being available in modern .NET. Create a dedicated benchmarking project to compare HTTP/2 vs HTTP/3 performance and validate optimization claims.
- [ ] Create new benchmark project: perf/Grpc.Net.PerformanceBenchmarks/Http3VsHttp2Benchmarks.cs using BenchmarkDotNet
- [ ] Add benchmarks measuring latency, throughput, and memory for unary/streaming calls on both HTTP/2 and HTTP/3
- [ ] Add HTTP/3 integration tests to validate protocol negotiation in test/Grpc.AspNetCore.Server.Tests/
- [ ] Create doc/performance.md documenting benchmark results and HTTP/3 adoption guidance
- [ ] Add benchmark execution step to .github/workflows/test.yml or create separate performance workflow
Add missing security documentation and tests for authentication/authorization flows
README mentions that gRPC on ASP.NET Core 'integrates with standard ASP.NET Core features like logging, dependency injection, authentication and authorization' but SECURITY.md exists without detail. There are no visible auth-specific integration tests. Document and test JWT, mTLS, custom authentication handlers, and role-based authorization with concrete examples.
- [ ] Expand SECURITY.md with specific authentication/authorization examples (JWT, mTLS, custom handlers) and threat model
- [ ] Create test/Grpc.AspNetCore.Server.Tests/AuthenticationAuthorizationTests.cs covering Bearer token validation, certificate-based auth, and authorization policies
- [ ] Add example: examples/Authentication/ with complete JWT and mTLS server/client setup and corresponding .proto files
- [ ] Add security best practices section to doc/ referencing OWASP gRPC guidance
- [ ] Reference new auth tests in CONTRIBUTING.md testing guidelines
🌿Good first issues
- Add XML documentation comments to public APIs in src/Grpc.Net.Client/Internal/ that lack docstring coverage. Cross-reference doc/packages.md to understand which classes are public API.
- Create an additional example in examples/ (e.g., examples/Authentication) demonstrating gRPC with token-based auth using Grpc.AspNetCore's built-in authorization support. Use examples/Aggregator as a template.
- Extend the troubleshooting guide (TROUBLESHOOTING.md) with a section on HTTP/2 negotiation failures on Windows Server and macOS, referencing doc/implementation_comparison.md's HTTP/2 notes and linking to canonical solutions.
⭐Top contributors
Click to expand
Top contributors
- @dependabot[bot] — 38 commits
- @JamesNK — 32 commits
- @apolcyn — 5 commits
- @asheshvidyut — 3 commits
- @stanley-cheung — 3 commits
📝Recent commits
Click to expand
Recent commits
e242eb5— Bump axios from 1.15.0 to 1.16.0 in /testassets/InteropTestsGrpcWebWebsite/Tests (#2728) (dependabot[bot])878bf56— Bump basic-ftp from 5.3.0 to 5.3.1 in /testassets/InteropTestsGrpcWebWebsite/Tests (#2727) (dependabot[bot])db2dd7b— Bump fast-uri from 3.1.0 to 3.1.2 in /examples/Browser/Server/wwwroot (#2730) (dependabot[bot])2d5ca25— Update OpenTelemetry packages to latest stable (#2729) (JamesNK)cf6faf3— Add SECURITY.md (#2722) (JamesNK)069019e— Fix flaky DuplexStream_SendToUnimplementedMethod_ThrowError test (#2720) (JamesNK)9092884— Bump protobufjs from 7.5.3 to 7.5.5 in /examples/Browser/Server/wwwroot (#2721) (dependabot[bot])fc84e9e— Bump basic-ftp from 5.2.2 to 5.3.0 in /testassets/InteropTestsGrpcWebWebsite/Tests (#2719) (dependabot[bot])77ba242— Resolver: fix 'retreive'/'retreiveing' typos in XML doc comments (#2718) (SAY-5)4be8d9d— Bump follow-redirects from 1.15.11 to 1.16.0 in /testassets/InteropTestsGrpcWebWebsite/Tests (#2717) (dependabot[bot])
🔒Security observations
Failed to generate security analysis.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.