├── .gitattributes ├── docfx ├── .gitignore ├── toc.yml └── README.md ├── .dockerignore ├── src ├── Grpc.AspNetCore │ └── lib │ │ ├── net10.0 │ │ └── _._ │ │ ├── net8.0 │ │ └── _._ │ │ └── net9.0 │ │ └── _._ ├── Grpc.Auth │ ├── README.md │ └── Grpc.Auth.csproj ├── Grpc.Reflection │ └── README.md ├── Grpc.Core.Api │ └── README.md ├── Grpc.HealthCheck │ └── README.md ├── Grpc.AspNetCore.HealthChecks │ └── README.md ├── Grpc.Net.Client │ └── Internal │ │ ├── IDebugger.cs │ │ ├── ISystemClock.cs │ │ ├── Configuration │ │ └── IConfigValue.cs │ │ └── SystemClock.cs ├── Grpc.AspNetCore.Server │ ├── ServerServiceDefinitionMarker.cs │ └── Internal │ │ ├── ISystemClock.cs │ │ └── SystemClock.cs ├── dotnet-grpc │ ├── Options │ │ ├── Access.cs │ │ └── Services.cs │ └── Internal │ │ └── CLIToolException.cs ├── Shared │ └── IsExternalInit.cs ├── Grpc.Net.ClientFactory │ └── Internal │ │ └── GrpcClientMappingRegistry.cs └── Grpc.AspNetCore.Web │ └── Internal │ └── ServerGrpcWebMode.cs ├── AUTHORS ├── test ├── dotnet-grpc.Tests │ └── TestAssets │ │ ├── EmptyProject │ │ ├── Proto │ │ │ ├── a.proto │ │ │ └── b.proto │ │ └── test.csproj │ │ ├── ProjectWithReference │ │ ├── Proto │ │ │ └── a.proto │ │ └── test.csproj │ │ ├── DuplicateProjects │ │ ├── client.csproj │ │ └── server.csproj │ │ └── MultipleReferences │ │ └── test.csproj ├── FunctionalTests │ ├── server1.pfx │ ├── localhost.pfx │ └── Infrastructure │ │ ├── TestConstants.cs │ │ └── TestServerEndpointName.cs ├── Grpc.AspNetCore.Server.Tests │ ├── Certs │ │ └── outlookcom.crt │ ├── TestObjects │ │ ├── CustomMetadata.cs │ │ └── Services │ │ │ ├── RaceServiceImpl.cs │ │ │ ├── WithAttribute │ │ │ ├── GreeterWithAttributeService.cs │ │ │ ├── GreeterWithAttributeServiceSubClass.cs │ │ │ └── GreeterWithAttributeServiceSubSubClass.cs │ │ │ └── WithoutAttribute │ │ │ ├── GreeterWithoutAttributeService.cs │ │ │ ├── GreeterWithoutAttributeServiceSubClass.cs │ │ │ └── GreeterWithoutAttributeServiceSubSubClass.cs │ └── Proto │ │ └── race.proto ├── Directory.Build.props ├── Grpc.StatusProto.Tests │ └── Grpc.StatusProto.Tests.csproj ├── Shared │ └── Logging │ │ ├── BeginScopeContext.cs │ │ ├── LogLevelAttribute.cs │ │ ├── TestLoggerProvider.cs │ │ ├── TestLoggerFactory.cs │ │ └── ITestSink.cs ├── Grpc.Core.Api.Tests │ └── Grpc.Core.Api.Tests.csproj ├── Grpc.HealthCheck.Tests │ └── Grpc.HealthCheck.Tests.csproj ├── Grpc.Reflection.Tests │ └── Grpc.Reflection.Tests.csproj └── Grpc.Net.Client.Tests │ └── Infrastructure │ ├── Http2StreamException.cs │ └── QuicStreamAbortedException.cs ├── keys ├── Grpc.snk ├── Grpc.public.snk └── README.md ├── packageIcon.png ├── doc └── images │ └── packages.png ├── kokoro ├── README.md ├── interop.cfg ├── linux.cfg └── build_nuget.cfg ├── examples ├── Browser │ ├── Browser.slnx │ └── Server │ │ ├── wwwroot │ │ ├── favicon.ico │ │ ├── webpack.config.js │ │ ├── package.json │ │ ├── index.html │ │ ├── .gitignore │ │ └── Scripts │ │ │ └── README.md │ │ ├── appsettings.json │ │ ├── appsettings.Development.json │ │ └── Server.csproj ├── Transcoder │ ├── Transcoder.slnx │ └── Server │ │ ├── wwwroot │ │ ├── favicon.ico │ │ └── images │ │ │ └── grpc-rest-logo.png │ │ ├── appsettings.json │ │ ├── appsettings.Development.json │ │ └── Server.csproj ├── Uploader │ ├── Client │ │ ├── pancakes.jpg │ │ └── Client.csproj │ ├── Uploader.slnx │ └── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ └── Program.cs ├── Downloader │ ├── Server │ │ ├── pancakes.jpg │ │ ├── pancakes4.png │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ └── Program.cs │ ├── Downloader.slnx │ └── Client │ │ └── Client.csproj ├── Blazor │ ├── Client │ │ ├── wwwroot │ │ │ ├── appsettings.json │ │ │ ├── grpc-logo.png │ │ │ ├── css │ │ │ │ └── open-iconic │ │ │ │ │ └── font │ │ │ │ │ └── fonts │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ └── open-iconic.woff │ │ │ └── index.html │ │ ├── Pages │ │ │ └── Index.razor │ │ ├── _Imports.razor │ │ ├── Shared │ │ │ ├── MainLayout.razor │ │ │ └── SurveyPrompt.razor │ │ ├── App.razor │ │ └── Client.csproj │ ├── Blazor.slnx │ ├── Server │ │ ├── appsettings.json │ │ ├── appsettings.Development.json │ │ ├── Server.csproj │ │ └── Properties │ │ │ └── launchSettings.json │ └── Proto │ │ └── count.proto ├── Certifier │ ├── Client │ │ ├── Certs │ │ │ └── client.pfx │ │ └── Client.csproj │ ├── Certifier.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ └── Server.csproj │ └── Proto │ │ └── certify.proto ├── Container │ ├── Frontend │ │ ├── wwwroot │ │ │ ├── favicon.ico │ │ │ ├── grpc-logo.png │ │ │ └── css │ │ │ │ └── open-iconic │ │ │ │ └── font │ │ │ │ └── fonts │ │ │ │ ├── open-iconic.eot │ │ │ │ ├── open-iconic.otf │ │ │ │ ├── open-iconic.ttf │ │ │ │ └── open-iconic.woff │ │ ├── Pages │ │ │ ├── Index.razor │ │ │ └── Error.cshtml.cs │ │ ├── appsettings.json │ │ ├── appsettings.Development.json │ │ ├── App.razor │ │ ├── Dockerfile │ │ ├── Shared │ │ │ ├── MainLayout.razor │ │ │ └── SurveyPrompt.razor │ │ ├── _Imports.razor │ │ └── Frontend.csproj │ ├── Container.slnx │ ├── Backend │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Dockerfile │ │ ├── Backend.csproj │ │ └── Program.cs │ ├── deploy.ps1 │ └── docker-compose.yml ├── Error │ ├── Error.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ └── Program.cs │ └── Client │ │ └── Client.csproj ├── Racer │ ├── Racer.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ └── Program.cs │ ├── Client │ │ └── Client.csproj │ └── Proto │ │ └── race.proto ├── Vigor │ ├── Vigor.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Server.csproj │ │ └── Properties │ │ │ └── launchSettings.json │ └── Client │ │ └── Client.csproj ├── Counter │ ├── Counter.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ ├── Program.cs │ │ └── IncrementingCounter.cs │ └── Client │ │ └── Client.csproj ├── Greeter │ ├── Greeter.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ └── Program.cs │ └── Client │ │ └── Client.csproj ├── Locator │ ├── Locator.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── Server.csproj │ ├── Client │ │ └── Client.csproj │ └── Proto │ │ ├── external.proto │ │ └── internal.proto ├── Mailer │ ├── Mailer.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ └── Program.cs │ └── Client │ │ └── Client.csproj ├── Retrier │ ├── Retrier.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ └── Program.cs │ ├── Client │ │ └── Client.csproj │ └── Proto │ │ └── retry.proto ├── Worker │ ├── Worker.slnx │ ├── Client │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── Client.csproj │ └── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ ├── Program.cs │ │ └── IncrementingCounter.cs ├── Aggregator │ ├── Aggregator.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ └── IncrementingCounter.cs │ ├── Client │ │ └── Client.csproj │ └── Proto │ │ └── aggregate.proto ├── Channeler │ ├── Channeler.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ └── Program.cs │ └── Client │ │ └── Client.csproj ├── Compressor │ ├── Compressor.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ └── Program.cs │ └── Client │ │ └── Client.csproj ├── Progressor │ ├── Progressor.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ ├── Monarchs-of-England.txt │ │ └── Program.cs │ └── Client │ │ └── Client.csproj ├── Reflector │ ├── Reflector.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ └── Program.cs │ └── Client │ │ └── Client.csproj ├── Ticketer │ ├── Ticketer.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ └── Server.csproj │ └── Client │ │ └── Client.csproj ├── Frameworker │ ├── Frameworker.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ └── Program.cs │ └── Client │ │ └── Client.csproj ├── Interceptor │ ├── Interceptor.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ └── Server.csproj │ └── Client │ │ └── Client.csproj ├── Transporter │ ├── Transporter.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── Server.csproj │ └── Client │ │ └── Client.csproj ├── Coder │ ├── Coder.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ └── Program.cs │ ├── Shared │ │ ├── Shared.csproj │ │ ├── HelloReply.cs │ │ └── HelloRequest.cs │ └── Client │ │ └── Client.csproj ├── Liber │ ├── Liber.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ └── Program.cs │ ├── Common │ │ └── Common.csproj │ ├── Client │ │ └── Client.csproj │ └── Proto │ │ └── common.proto ├── Tester │ ├── Client │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Client.csproj │ │ └── IGreetRepository.cs │ ├── Tester.slnx │ ├── Server │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Server.csproj │ │ ├── Services │ │ │ └── IGreeter.cs │ │ └── Program.cs │ ├── Common │ │ └── Common.csproj │ └── Tests │ │ └── Tests.csproj └── Definer │ ├── Server │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Properties │ │ └── launchSettings.json │ └── Server.csproj │ ├── Client │ └── Client.csproj │ └── Definer.slnx ├── global.json ├── perf ├── benchmarkapps │ ├── GrpcCoreServer │ │ ├── hosting.json │ │ └── grpc-core-server.yml │ ├── Shared │ │ └── Certs │ │ │ ├── client.pfx │ │ │ ├── server1.pfx │ │ │ └── README.md │ ├── QpsWorker │ │ ├── Protos │ │ │ └── README.md │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── GrpcAspNetCoreServer │ │ ├── hosting.json │ │ ├── grpc-aspnetcore-server.yml │ │ └── RunGrpcServer.ps1 │ └── GrpcClient │ │ ├── Certs │ │ └── README.md │ │ └── GrpcClientType.cs └── Grpc.AspNetCore.Microbenchmarks │ ├── Properties │ └── AssemblyInfo.cs │ └── Proto │ └── chat.proto ├── testassets ├── Certs │ └── InteropTests │ │ ├── server1.pfx │ │ └── README.md ├── InteropTestsGrpcWebClient │ ├── Shared │ │ └── MainLayout.razor │ ├── _Imports.razor │ ├── App.razor │ └── Pages │ │ └── Index.razor ├── InteropTestsGrpcWebWebsite │ ├── Tests │ │ ├── jest.config.js │ │ ├── jest-puppeteer.config.js │ │ ├── package.json │ │ ├── __tests__ │ │ │ └── interoptests.js │ │ └── .gitignore │ ├── InteropTestsGrpcWebWebsite.csproj │ └── Dockerfile ├── BenchmarkWorkerWebsite │ └── README.md ├── InteropTestsWebsite │ ├── Dockerfile │ └── README.md ├── InteropTestsNativeServer │ ├── README.md │ ├── InteropTestsNativeServer.csproj │ └── Program.cs ├── FunctionalTestsWebsite │ └── Infrastructure │ │ ├── DynamicService.cs │ │ └── IncrementingCounter.cs └── Proto │ ├── race.proto │ ├── nested.proto │ ├── chat.proto │ ├── unimplemented.proto │ └── authorize.proto ├── GOVERNANCE.md ├── CODE-OF-CONDUCT.md ├── .github └── ISSUE_TEMPLATE │ ├── config.yml │ └── ask_question.md ├── CONTRIBUTING.md ├── docker-compose.yml ├── .gitignore ├── startvs.cmd └── TROUBLESHOOTING.md /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sh -lf 2 | -------------------------------------------------------------------------------- /docfx/.gitignore: -------------------------------------------------------------------------------- 1 | html 2 | obj 3 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | **/bin 2 | **/obj 3 | .vs -------------------------------------------------------------------------------- /src/Grpc.AspNetCore/lib/net10.0/_._: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Grpc.AspNetCore/lib/net8.0/_._: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Grpc.AspNetCore/lib/net9.0/_._: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Google Inc. 2 | Microsoft Inc. 3 | -------------------------------------------------------------------------------- /test/dotnet-grpc.Tests/TestAssets/EmptyProject/Proto/a.proto: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/dotnet-grpc.Tests/TestAssets/EmptyProject/Proto/b.proto: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/dotnet-grpc.Tests/TestAssets/ProjectWithReference/Proto/a.proto: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /keys/Grpc.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/keys/Grpc.snk -------------------------------------------------------------------------------- /packageIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/packageIcon.png -------------------------------------------------------------------------------- /keys/Grpc.public.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/keys/Grpc.public.snk -------------------------------------------------------------------------------- /doc/images/packages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/doc/images/packages.png -------------------------------------------------------------------------------- /docfx/toc.yml: -------------------------------------------------------------------------------- 1 | - name: API Documentation 2 | href: obj/api/ 3 | homepage: obj/api/Grpc.Core.yml 4 | -------------------------------------------------------------------------------- /kokoro/README.md: -------------------------------------------------------------------------------- 1 | Configuration files and helper scripts for Google-internal CI tool called "Kokoro". -------------------------------------------------------------------------------- /examples/Browser/Browser.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /examples/Transcoder/Transcoder.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "10.0.100", 4 | "rollForward": "latestFeature" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/FunctionalTests/server1.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/test/FunctionalTests/server1.pfx -------------------------------------------------------------------------------- /test/dotnet-grpc.Tests/TestAssets/DuplicateProjects/client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test/dotnet-grpc.Tests/TestAssets/DuplicateProjects/server.csproj: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/FunctionalTests/localhost.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/test/FunctionalTests/localhost.pfx -------------------------------------------------------------------------------- /test/dotnet-grpc.Tests/TestAssets/EmptyProject/test.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /examples/Uploader/Client/pancakes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Uploader/Client/pancakes.jpg -------------------------------------------------------------------------------- /perf/benchmarkapps/GrpcCoreServer/hosting.json: -------------------------------------------------------------------------------- 1 | { 2 | "urls": "", 3 | "server.urls": "", 4 | "protocol": "h2c" 5 | } 6 | -------------------------------------------------------------------------------- /src/Grpc.Auth/README.md: -------------------------------------------------------------------------------- 1 | # Grpc.Auth 2 | 3 | `Grpc.Auth` is the gRPC C#/.NET authentication library based on `Google.Apis.Auth` -------------------------------------------------------------------------------- /examples/Downloader/Server/pancakes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Downloader/Server/pancakes.jpg -------------------------------------------------------------------------------- /examples/Downloader/Server/pancakes4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Downloader/Server/pancakes4.png -------------------------------------------------------------------------------- /examples/Blazor/Client/wwwroot/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | // Explicit backend URL (override current site) 3 | "BackendUrl": null 4 | } 5 | -------------------------------------------------------------------------------- /examples/Browser/Server/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Browser/Server/wwwroot/favicon.ico -------------------------------------------------------------------------------- /examples/Certifier/Client/Certs/client.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Certifier/Client/Certs/client.pfx -------------------------------------------------------------------------------- /perf/benchmarkapps/Shared/Certs/client.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/perf/benchmarkapps/Shared/Certs/client.pfx -------------------------------------------------------------------------------- /perf/benchmarkapps/Shared/Certs/server1.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/perf/benchmarkapps/Shared/Certs/server1.pfx -------------------------------------------------------------------------------- /testassets/Certs/InteropTests/server1.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/testassets/Certs/InteropTests/server1.pfx -------------------------------------------------------------------------------- /examples/Blazor/Client/wwwroot/grpc-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Blazor/Client/wwwroot/grpc-logo.png -------------------------------------------------------------------------------- /examples/Container/Frontend/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Container/Frontend/wwwroot/favicon.ico -------------------------------------------------------------------------------- /examples/Error/Error.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Racer/Racer.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Transcoder/Server/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Transcoder/Server/wwwroot/favicon.ico -------------------------------------------------------------------------------- /examples/Vigor/Vigor.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/Grpc.Reflection/README.md: -------------------------------------------------------------------------------- 1 | # Grpc.Reflection 2 | 3 | `Grpc.Reflection` contains the reference implementation of gRPC reflection service. 4 | -------------------------------------------------------------------------------- /testassets/InteropTestsGrpcWebClient/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | @Body 5 |
6 | -------------------------------------------------------------------------------- /examples/Blazor/Blazor.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Container/Frontend/wwwroot/grpc-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Container/Frontend/wwwroot/grpc-logo.png -------------------------------------------------------------------------------- /examples/Counter/Counter.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Greeter/Greeter.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Locator/Locator.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Mailer/Mailer.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Retrier/Retrier.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Worker/Worker.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/Grpc.Core.Api/README.md: -------------------------------------------------------------------------------- 1 | # Grpc.Core.Api 2 | 3 | `Grpc.Core.Api` is the shared API package for gRPC C# and gRPC for .NET implementations of gRPC. 4 | -------------------------------------------------------------------------------- /src/Grpc.HealthCheck/README.md: -------------------------------------------------------------------------------- 1 | # Grpc.HealthCheck 2 | 3 | `Grpc.HealthCheck` contains the reference implementation of gRPC health check service. 4 | -------------------------------------------------------------------------------- /GOVERNANCE.md: -------------------------------------------------------------------------------- 1 | This repository is governed by the gRPC organization's [governance rules](https://github.com/grpc/grpc-community/blob/master/governance.md). 2 | -------------------------------------------------------------------------------- /examples/Aggregator/Aggregator.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Certifier/Certifier.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Channeler/Channeler.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Compressor/Compressor.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Downloader/Downloader.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Progressor/Progressor.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Reflector/Reflector.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Ticketer/Ticketer.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Uploader/Uploader.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Container/Container.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Frameworker/Frameworker.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Interceptor/Interceptor.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Transporter/Transporter.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /test/Grpc.AspNetCore.Server.Tests/Certs/outlookcom.crt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/test/Grpc.AspNetCore.Server.Tests/Certs/outlookcom.crt -------------------------------------------------------------------------------- /CODE-OF-CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Community Code of Conduct 2 | 3 | gRPC follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). 4 | -------------------------------------------------------------------------------- /examples/Blazor/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /examples/Browser/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /examples/Transcoder/Server/wwwroot/images/grpc-rest-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Transcoder/Server/wwwroot/images/grpc-rest-logo.png -------------------------------------------------------------------------------- /examples/Transcoder/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /perf/benchmarkapps/QpsWorker/Protos/README.md: -------------------------------------------------------------------------------- 1 | Protobuf contracts used by the QpsWorker. 2 | 3 | Files are copied from https://github.com/grpc/grpc/tree/master/src/proto/grpc 4 | -------------------------------------------------------------------------------- /examples/Blazor/Client/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

Hello, world!

4 | 5 | Welcome to your new app. 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/Container/Frontend/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

Hello, world!

4 | 5 | Welcome to your new app. 6 | 7 | 8 | -------------------------------------------------------------------------------- /testassets/InteropTestsGrpcWebWebsite/Tests/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testEnvironment: "./custom-environment.js", 3 | verbose: true, 4 | preset: "jest-puppeteer" 5 | }; -------------------------------------------------------------------------------- /examples/Blazor/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Blazor/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /examples/Blazor/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Blazor/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /examples/Blazor/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Blazor/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /examples/Coder/Coder.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/Liber/Liber.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /testassets/BenchmarkWorkerWebsite/README.md: -------------------------------------------------------------------------------- 1 | Implementation of benchmark worker that is compatible with the gRPC benchmarking stack: 2 | https://grpc.io/docs/guides/benchmarking.html 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/Blazor/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Blazor/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /perf/benchmarkapps/QpsWorker/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "Microsoft.AspNetCore": "Debug" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/Container/Frontend/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Container/Frontend/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /examples/Container/Frontend/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Container/Frontend/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /examples/Container/Frontend/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Container/Frontend/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /examples/Container/Frontend/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-dotnet/HEAD/examples/Container/Frontend/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /testassets/InteropTestsGrpcWebWebsite/Tests/jest-puppeteer.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | launch: { 3 | dumpio: true, 4 | headless: true, 5 | }, 6 | browserContext: 'default', 7 | } -------------------------------------------------------------------------------- /examples/Tester/Client/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/Worker/Client/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /perf/benchmarkapps/GrpcAspNetCoreServer/hosting.json: -------------------------------------------------------------------------------- 1 | { 2 | "urls": "", 3 | "server.urls": "", 4 | "protocol": "h2c", // This will be overriden when benchmarks are run 5 | "certificateAuth": false, 6 | "LogLevel": "" 7 | } 8 | -------------------------------------------------------------------------------- /examples/Tester/Tester.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Issue with Grpc.Core 4 | url: https://github.com/grpc/grpc/issues/new/choose 5 | about: Please open issues relating to Grpc.Core in grpc/grpc. 6 | -------------------------------------------------------------------------------- /examples/Blazor/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Coder/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Container/Frontend/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Trace", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "BackendUrl": "https://localhost:5101" 10 | } 11 | -------------------------------------------------------------------------------- /examples/Error/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Liber/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Mailer/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Racer/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Tester/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Vigor/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Worker/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Aggregator/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Browser/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Certifier/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Channeler/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Compressor/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Container/Backend/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Counter/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Definer/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Downloader/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Frameworker/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Greeter/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Interceptor/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Locator/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Progressor/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Reflector/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Retrier/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Ticketer/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Transcoder/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Transporter/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Uploader/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Grpc": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Tester/Client/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Grpc": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Worker/Client/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Grpc": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Container/Backend/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Trace" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Certifier/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Channeler/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Coder/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Container/Frontend/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Trace", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/Counter/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Definer/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Error/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Greeter/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Liber/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Locator/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Mailer/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Racer/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Reflector/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Retrier/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Tester/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Ticketer/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Vigor/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Worker/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Grpc.AspNetCore.HealthChecks/README.md: -------------------------------------------------------------------------------- 1 | Grpc.AspNetCore.HealthChecks provides integration between [Health checks in ASP.NET Core](https://docs.microsoft.com/aspnet/core/host-and-deploy/health-checks) and the [Grpc.HealthCheck package](https://www.nuget.org/packages/Grpc.HealthCheck). -------------------------------------------------------------------------------- /test/dotnet-grpc.Tests/TestAssets/ProjectWithReference/test.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | https://contoso.com/greet.proto 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/Aggregator/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Compressor/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Downloader/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Frameworker/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Interceptor/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Progressor/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Transporter/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Coder/Shared/Shared.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /perf/benchmarkapps/GrpcClient/Certs/README.md: -------------------------------------------------------------------------------- 1 | These certs are generated via openssl according to https://stackoverflow.com/questions/37714558/how-to-enable-server-side-ssl-for-grpc. The server.crt and server.key were combined into server.pfx. The password is 1111. These certs are not secure, do not use in production. -------------------------------------------------------------------------------- /examples/Vigor/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/Uploader/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "Kestrel": { 9 | "EndpointDefaults": { 10 | "Protocols": "Http2" 11 | } 12 | }, 13 | "StoredFilesPath": "./uploads" 14 | } 15 | -------------------------------------------------------------------------------- /examples/Browser/Server/wwwroot/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | entry: './Scripts/index.js', 5 | output: { 6 | filename: 'main.js', 7 | path: path.resolve(__dirname, 'dist'), 8 | }, 9 | mode: 'development', 10 | devtool: 'source-map' 11 | }; -------------------------------------------------------------------------------- /perf/benchmarkapps/QpsWorker/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "Microsoft.AspNetCore": "Debug" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "Kestrel": { 10 | "EndpointDefaults": { 11 | "Protocols": "Http2" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/dotnet-grpc.Tests/TestAssets/MultipleReferences/test.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | https://contoso.com/greet.proto 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | We definitely welcome patches and contributions to grpc-dotnet! Please read the gRPC 4 | organization's [governance rules](https://github.com/grpc/grpc-community/blob/master/governance.md) 5 | and [contribution guidelines](https://github.com/grpc/grpc-community/blob/master/CONTRIBUTING.md) before proceeding. 6 | -------------------------------------------------------------------------------- /testassets/InteropTestsGrpcWebWebsite/Tests/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "grpc-web_interop_tests", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "test": "jest test" 7 | }, 8 | "dependencies": { 9 | "jest": "^30.0.5", 10 | "jest-puppeteer": "^11.0.0", 11 | "puppeteer": "^24.15.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/Certifier/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Channeler/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Coder/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Counter/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Definer/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Error/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Greeter/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Liber/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Mailer/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Racer/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Reflector/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Retrier/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Tester/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Ticketer/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Uploader/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Vigor/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Worker/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Aggregator/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Compressor/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Downloader/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Frameworker/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Interceptor/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/Progressor/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Server": { 4 | "commandName": "Project", 5 | "launchBrowser": false, 6 | "applicationUrl": "https://localhost:5001", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/Tester/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Blazor/Client/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Threading 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.JSInterop 7 | @using Client 8 | @using Client.Shared 9 | @using Count 10 | @using Grpc.Net.Client 11 | @using Weather 12 | -------------------------------------------------------------------------------- /examples/Container/deploy.ps1: -------------------------------------------------------------------------------- 1 | docker compose -f .\docker-compose.yml build container-frontend 2 | docker compose -f .\docker-compose.yml build container-backend 3 | 4 | kubectl delete -f .\Kubernetes\deploy-backend.yml 5 | kubectl apply -f .\Kubernetes\deploy-backend.yml 6 | 7 | kubectl delete -f .\Kubernetes\deploy-frontend.yml 8 | kubectl apply -f .\Kubernetes\deploy-frontend.yml 9 | -------------------------------------------------------------------------------- /examples/Coder/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /testassets/InteropTestsGrpcWebClient/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Threading 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.JSInterop 7 | @using InteropTestsGrpcWebClient 8 | @using InteropTestsGrpcWebClient.Shared 9 | @using Grpc.Net.Client 10 | -------------------------------------------------------------------------------- /examples/Blazor/Client/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 | -------------------------------------------------------------------------------- /examples/Coder/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Mailer/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Racer/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Counter/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Greeter/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Retrier/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Worker/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Compressor/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Frameworker/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Interceptor/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Transporter/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Uploader/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Downloader/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Blazor/Client/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /examples/Channeler/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /keys/README.md: -------------------------------------------------------------------------------- 1 | Contents 2 | -------- 3 | 4 | - Grpc.public.snk: 5 | Public key to verify strong name of gRPC assemblies. 6 | - Grpc.snk: 7 | Signing key to provide strong name of gRPC assemblies. 8 | As per https://msdn.microsoft.com/en-us/library/wd40t7ad(v=vs.110).aspx 9 | signing key should be checked into the repository. 10 | 11 | These keys originated from https://github.com/grpc/grpc/tree/master/src/csharp/keys. 12 | -------------------------------------------------------------------------------- /testassets/InteropTestsGrpcWebClient/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /examples/Browser/Server/wwwroot/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "browser-server", 4 | "private": true, 5 | "scripts": { 6 | "build": "webpack", 7 | "build:watch": "webpack --watch" 8 | }, 9 | "devDependencies": { 10 | "@grpc/proto-loader": "^0.8.0", 11 | "google-protobuf": "^3.21.4", 12 | "grpc-web": "^1.5.0", 13 | "webpack": "^5.94.0", 14 | "webpack-cli": "^6.0.1" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | grpcweb-server: 3 | build: 4 | context: ./ 5 | dockerfile: ./testassets/InteropTestsWebsite/Dockerfile 6 | image: grpc-dotnet/grpcweb-server 7 | ports: 8 | - "8080:80" 9 | grpcweb-client: 10 | build: 11 | context: ./ 12 | dockerfile: ./testassets/InteropTestsGrpcWebWebsite/Dockerfile 13 | image: grpc-dotnet/grpcweb-client 14 | ports: 15 | - "8081:80" 16 | -------------------------------------------------------------------------------- /examples/Container/Frontend/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /examples/Liber/Common/Common.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/Container/Backend/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build-env 2 | WORKDIR /app 3 | 4 | # Copy everything 5 | COPY . ./ 6 | RUN dotnet --info 7 | RUN dotnet restore examples/Container/Backend 8 | RUN dotnet publish examples/Container/Backend -c Release -o out 9 | 10 | # Build runtime image 11 | FROM mcr.microsoft.com/dotnet/aspnet:10.0 12 | WORKDIR /app 13 | COPY --from=build-env /app/out . 14 | ENTRYPOINT ["dotnet", "Backend.dll"] -------------------------------------------------------------------------------- /examples/Error/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/Container/Frontend/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build-env 2 | WORKDIR /app 3 | 4 | # Copy everything 5 | COPY . ./ 6 | RUN dotnet --info 7 | RUN dotnet restore examples/Container/Frontend 8 | RUN dotnet publish examples/Container/Frontend -c Release -o out 9 | 10 | # Build runtime image 11 | FROM mcr.microsoft.com/dotnet/aspnet:10.0 12 | WORKDIR /app 13 | COPY --from=build-env /app/out . 14 | ENTRYPOINT ["dotnet", "Frontend.dll"] -------------------------------------------------------------------------------- /examples/Container/Frontend/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | About 11 |
12 | 13 |
14 | @Body 15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /examples/Liber/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /perf/benchmarkapps/GrpcCoreServer/grpc-core-server.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | grpcCoreServer: 3 | source: 4 | repository: https://github.com/grpc/grpc-dotnet.git 5 | branchOrCommit: master 6 | project: perf/benchmarkapps/GrpcCoreServer/GrpcCoreServer.csproj 7 | readyStateText: Application started 8 | waitForExit: false 9 | variables: 10 | serverScheme: http 11 | arguments: --server.urls {{serverScheme}}://{{serverAddress}}:{{serverPort}} 12 | -------------------------------------------------------------------------------- /examples/Reflector/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/Container/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | container-frontend: 3 | build: 4 | context: ./../../ 5 | dockerfile: ./examples/Container/Frontend/Dockerfile 6 | image: grpc-dotnet/container-frontend 7 | ports: 8 | - "8080:80" 9 | container-backend: 10 | build: 11 | context: ./../../ 12 | dockerfile: ./examples/Container/Backend/Dockerfile 13 | image: grpc-dotnet/container-backend 14 | ports: 15 | - "8081:80" 16 | -------------------------------------------------------------------------------- /examples/Ticketer/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /perf/benchmarkapps/Shared/Certs/README.md: -------------------------------------------------------------------------------- 1 | Keys taken from https://github.com/grpc/grpc/tree/master/src/core/tsi/test_creds 2 | so that interop server in this project is compatible with interop clients 3 | implemented in other gRPC languages. 4 | 5 | The server1.pem and server1.key were combined into server1.pfx. The password is 1111. These certs are not secure, do not use in production. 6 | ``` 7 | openssl pkcs12 -export -out server1.pfx -inkey server1.key -in server1.pem -certfile ca.pem 8 | ``` 9 | -------------------------------------------------------------------------------- /testassets/Certs/InteropTests/README.md: -------------------------------------------------------------------------------- 1 | Keys taken from https://github.com/grpc/grpc/tree/master/src/core/tsi/test_creds 2 | so that interop server in this project is compatible with interop clients 3 | implemented in other gRPC languages. 4 | 5 | The server1.pem and server1.key were combined into server1.pfx. The password is 1111. These certs are not secure, do not use in production. 6 | ``` 7 | openssl pkcs12 -export -out server1.pfx -inkey server1.key -in server1.pem -certfile ca.pem 8 | ``` 9 | -------------------------------------------------------------------------------- /examples/Certifier/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/Grpc.StatusProto.Tests/Grpc.StatusProto.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net462;net8.0;net9.0;net10.0 4 | true 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Tester/Common/Common.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /testassets/InteropTestsGrpcWebWebsite/InteropTestsGrpcWebWebsite.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/Locator/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/Reflector/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/Vigor/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/Tester/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | dotnet-Client-33BD397C-6A11-40D0-AF85-24B9610F7517 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /testassets/InteropTestsGrpcWebWebsite/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build-env 2 | WORKDIR /app 3 | 4 | # Copy everything 5 | COPY . ./ 6 | RUN dotnet --info 7 | RUN dotnet restore testassets/InteropTestsGrpcWebWebsite 8 | RUN dotnet publish testassets/InteropTestsGrpcWebWebsite -c Release -o out 9 | 10 | # Build runtime image 11 | FROM mcr.microsoft.com/dotnet/aspnet:10.0 12 | WORKDIR /app 13 | COPY --from=build-env /app/out . 14 | ENTRYPOINT ["dotnet", "InteropTestsGrpcWebWebsite.dll", "--urls", "http://+:80"] 15 | -------------------------------------------------------------------------------- /testassets/InteropTestsWebsite/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build-env 2 | WORKDIR /app 3 | 4 | # Copy everything 5 | COPY . ./ 6 | RUN dotnet --info 7 | RUN dotnet restore testassets/InteropTestsWebsite 8 | RUN dotnet publish testassets/InteropTestsWebsite --framework net10.0 -c Release -o out -p:LatestFramework=true 9 | 10 | # Build runtime image 11 | FROM mcr.microsoft.com/dotnet/aspnet:10.0 12 | WORKDIR /app 13 | COPY --from=build-env /app/out . 14 | ENTRYPOINT ["dotnet", "InteropTestsWebsite.dll", "--port_http1", "80"] -------------------------------------------------------------------------------- /examples/Mailer/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/Counter/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/Greeter/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/Racer/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/Shared/Logging/BeginScopeContext.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #nullable disable 5 | 6 | // Copied with permission from https://github.com/dotnet/aspnetcore/tree/08b60af1bca8cffff8ba0a72164fb7505ffe114d/src/Testing/src/Logging 7 | namespace Microsoft.Extensions.Logging.Testing; 8 | 9 | public class BeginScopeContext 10 | { 11 | public object Scope { get; set; } 12 | 13 | public string LoggerName { get; set; } 14 | } 15 | -------------------------------------------------------------------------------- /examples/Compressor/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/Container/Backend/Backend.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/Uploader/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/Retrier/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/Ticketer/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/Transporter/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/Downloader/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/Progressor/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /perf/benchmarkapps/GrpcAspNetCoreServer/grpc-aspnetcore-server.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | grpcAspNetCoreServer: 3 | source: 4 | repository: https://github.com/grpc/grpc-dotnet.git 5 | branchOrCommit: master 6 | project: perf/benchmarkapps/GrpcAspNetCoreServer/GrpcAspNetCoreServer.csproj 7 | readyStateText: Application started 8 | waitForExit: false 9 | variables: 10 | protocol: h2c 11 | enableCertAuth: false 12 | logLevel: None 13 | arguments: "--LogLevel {{logLevel}} --enableCertAuth {{enableCertAuth}} --protocol {{protocol}}" -------------------------------------------------------------------------------- /testassets/InteropTestsNativeServer/README.md: -------------------------------------------------------------------------------- 1 | # Interop Tests Native Server 2 | 3 | This project is a copy of [InteropServer.cs](https://github.com/grpc/grpc/blob/912653e3ce504b9148409e577bc2028c4454d89c/src/csharp/Grpc.IntegrationTesting/InteropServer.cs) from https://github.com/grpc/grpc. The C# C Core native server is copied here to allow easier initial testing of the managed gRPC client against C Core. It could be removed from this repo in the future. 4 | 5 | The authoritative copy of the interop tests is https://github.com/grpc/grpc. This copy may become out of date. 6 | -------------------------------------------------------------------------------- /examples/Channeler/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/Definer/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/Progressor/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | PreserveNewest 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /testassets/InteropTestsGrpcWebWebsite/Tests/__tests__/interoptests.js: -------------------------------------------------------------------------------- 1 | describe('gRPC-Web interop tests', () => { 2 | test.each(global.__GRPC_WEB_TEST_NAMES__)('Run %s (grpc-web)', async (testName) => { 3 | var result = await page.evaluate((n) => runTest(n, "GrpcWeb"), testName); 4 | expect(result).toBe("Success"); 5 | }); 6 | 7 | test.each(global.__GRPC_WEB_TEXT_TEST_NAMES__)('Run %s (grpc-web-text)', async (testName) => { 8 | var result = await page.evaluate((n) => runTest(n, "GrpcWebText"), testName); 9 | expect(result).toBe("Success"); 10 | }); 11 | }); -------------------------------------------------------------------------------- /examples/Error/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/Blazor/Client/Shared/SurveyPrompt.razor: -------------------------------------------------------------------------------- 1 | 11 | 12 | @code { 13 | // Demonstrates how a parent component can supply parameters 14 | [Parameter] 15 | public string? Title { get; set; } 16 | } 17 | -------------------------------------------------------------------------------- /examples/Container/Frontend/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Threading 3 | @using Microsoft.AspNetCore.Authorization 4 | @using Microsoft.AspNetCore.Components.Authorization 5 | @using Microsoft.AspNetCore.Components.Forms 6 | @using Microsoft.AspNetCore.Components.Routing 7 | @using Microsoft.AspNetCore.Components.Web 8 | @using Microsoft.AspNetCore.Components.Web.Virtualization 9 | @using Microsoft.JSInterop 10 | @using Frontend 11 | @using Frontend.Balancer 12 | @using Frontend.Shared 13 | @using Grpc.Core 14 | @using Grpc.Net.Client 15 | @using Grpc.Net.Client.Balancer 16 | @using Weather 17 | -------------------------------------------------------------------------------- /examples/Container/Frontend/Shared/SurveyPrompt.razor: -------------------------------------------------------------------------------- 1 | 11 | 12 | @code { 13 | // Demonstrates how a parent component can supply parameters 14 | [Parameter] 15 | public string? Title { get; set; } 16 | } 17 | -------------------------------------------------------------------------------- /examples/Liber/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | [Oo]bj/ 2 | [Bb]in/ 3 | TestResults/ 4 | .nuget/ 5 | *.sln.ide/ 6 | _ReSharper.*/ 7 | .idea/ 8 | packages/ 9 | artifacts/ 10 | PublishProfiles/ 11 | .vs/ 12 | *.user 13 | *.suo 14 | *.cache 15 | *.docstates 16 | _ReSharper.* 17 | nuget.exe 18 | *net45.csproj 19 | *net451.csproj 20 | *k10.csproj 21 | *.psess 22 | *.vsp 23 | *.pidb 24 | *.userprefs 25 | *DS_Store 26 | *.ncrunchsolution 27 | *.*sdf 28 | *.ipch 29 | *.swp 30 | *~ 31 | .build/ 32 | .testPublish/ 33 | launchSettings.json 34 | BenchmarkDotNet.Artifacts/ 35 | BDN.Generated/ 36 | binaries/ 37 | .vscode/ 38 | *.binlog 39 | build/feed 40 | .dotnet/ 41 | *.log.txt 42 | -------------------------------------------------------------------------------- /examples/Frameworker/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net4.7.2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/Browser/Server/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | gRPC-Web ASP.NET Core example 6 | 7 | 8 |

gRPC-Web ASP.NET Core example

9 |
10 | Hello: 11 | 12 | 13 | 14 |
15 |
16 |

17 |
18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /examples/Locator/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/Transcoder/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | true 6 | $(NoWarn);1591 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/Certifier/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | PreserveNewest 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /examples/Worker/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | dotnet-Client-33BD397C-6A11-40D0-AF85-24B9610F7517 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/Interceptor/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/Definer/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /examples/Blazor/Client/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | gRPC-Web in Blazor 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Loading...
15 | 16 |
17 | An unhandled error has occurred. 18 | Reload 19 | 🗙 20 |
21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /examples/Browser/Server/wwwroot/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /dist-server 6 | /tmp 7 | /out-tsc 8 | 9 | # dependencies 10 | /node_modules 11 | 12 | # IDEs and editors 13 | /.idea 14 | .project 15 | .classpath 16 | .c9/ 17 | *.launch 18 | .settings/ 19 | *.sublime-workspace 20 | 21 | # IDE - VSCode 22 | .vscode/* 23 | !.vscode/settings.json 24 | !.vscode/tasks.json 25 | !.vscode/launch.json 26 | !.vscode/extensions.json 27 | 28 | # misc 29 | /.sass-cache 30 | /connect.lock 31 | /coverage 32 | /libpeerconnection.log 33 | npm-debug.log 34 | yarn-error.log 35 | testem.log 36 | /typings 37 | 38 | # System Files 39 | .DS_Store 40 | Thumbs.db 41 | -------------------------------------------------------------------------------- /testassets/InteropTestsGrpcWebWebsite/Tests/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /dist-server 6 | /tmp 7 | /out-tsc 8 | 9 | # dependencies 10 | /node_modules 11 | 12 | # IDEs and editors 13 | /.idea 14 | .project 15 | .classpath 16 | .c9/ 17 | *.launch 18 | .settings/ 19 | *.sublime-workspace 20 | 21 | # IDE - VSCode 22 | .vscode/* 23 | !.vscode/settings.json 24 | !.vscode/tasks.json 25 | !.vscode/launch.json 26 | !.vscode/extensions.json 27 | 28 | # misc 29 | /.sass-cache 30 | /connect.lock 31 | /coverage 32 | /libpeerconnection.log 33 | npm-debug.log 34 | yarn-error.log 35 | testem.log 36 | /typings 37 | 38 | # System Files 39 | .DS_Store 40 | Thumbs.db 41 | -------------------------------------------------------------------------------- /test/Grpc.Core.Api.Tests/Grpc.Core.Api.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net462;net8.0;net9.0;net10.0 4 | true 5 | true 6 | 7 | 8 | disable 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net462;net8.0;net9.0;net10.0 4 | true 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net462;net8.0;net9.0;net10.0 4 | true 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /testassets/InteropTestsGrpcWebClient/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @inject IJSRuntime JSRuntime; 3 | 4 |

gRPC-Web interop tests

5 | 6 |
7 | 14 | 15 | 16 |
17 | 18 | -------------------------------------------------------------------------------- /examples/Aggregator/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/Shared/Logging/LogLevelAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #nullable disable 5 | 6 | using System; 7 | 8 | // Copied with permission from https://github.com/dotnet/aspnetcore/tree/08b60af1bca8cffff8ba0a72164fb7505ffe114d/src/Testing/src/Logging 9 | namespace Microsoft.Extensions.Logging.Testing; 10 | 11 | [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = false)] 12 | public class LogLevelAttribute : Attribute 13 | { 14 | public LogLevelAttribute(LogLevel logLevel) 15 | { 16 | LogLevel = logLevel; 17 | } 18 | 19 | public LogLevel LogLevel { get; } 20 | } 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/ask_question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Ask a question 3 | about: Ask a question related to this project 4 | labels: question 5 | 6 | --- 7 | 8 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /examples/Definer/Definer.slnx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/Progressor/Server/Monarchs-of-England.txt: -------------------------------------------------------------------------------- 1 | Offa Egbert Aethelwulf Aethelbald Aethelbert Aethelred I Alfred the Great Edward the Elder Athelstan Edmund Edred Edwy Edgar Edward the Martyr Ethelred II the Unready Edmund lronside Cnut (Canute) Harold I Harefoot Harthacanut Edward the Confessor Harold II William I William II Henry I Stephen Henry II Richard I John Henry III Edward I Edward II Edward III Richard II Henry IV Henry V Henry VI Edward IV Edward V Richard III Henry VII Henry VIII Edward VI Mary I Elizabeth I James I Charles I Commonwealth Oliver Cromwell Richard Cromwell Charles II James II William III of Orange and Mary II (jointly) William III (alone) Anne George I George II George III George IV William IV Victoria Edward VII George V Edward VIII George VI Elizabeth II 2 | -------------------------------------------------------------------------------- /testassets/InteropTestsNativeServer/InteropTestsNativeServer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net10.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | PreserveNewest 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /examples/Container/Frontend/Frontend.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | $(NoWarn);CS0618 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /examples/Tester/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /examples/Blazor/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 46982f83-f153-443e-b589-4b2bc7b5945e 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/Shared/Logging/TestLoggerProvider.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #nullable disable 5 | 6 | // Copied with permission from https://github.com/dotnet/aspnetcore/tree/08b60af1bca8cffff8ba0a72164fb7505ffe114d/src/Testing/src/Logging 7 | namespace Microsoft.Extensions.Logging.Testing; 8 | 9 | public class TestLoggerProvider : ILoggerProvider 10 | { 11 | private readonly ITestSink _sink; 12 | 13 | public TestLoggerProvider(ITestSink sink) 14 | { 15 | _sink = sink; 16 | } 17 | 18 | public ILogger CreateLogger(string categoryName) 19 | { 20 | return new TestLogger(categoryName, _sink, enabled: true); 21 | } 22 | 23 | public void Dispose() 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /examples/Liber/Proto/common.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The gRPC Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package common; 18 | 19 | message Name { 20 | string firstName = 1; 21 | string middleName = 2; 22 | string lastName = 3; 23 | } 24 | -------------------------------------------------------------------------------- /examples/Browser/Server/wwwroot/Scripts/README.md: -------------------------------------------------------------------------------- 1 | # gRPC-Web generated client 2 | 3 | gRPC-Web JavaScript clients and messages are generated using `protoc` the gRPC-Web code generator plugin. Instructions for using it are available [here](https://github.com/grpc/grpc-web#code-generator-plugin). 4 | 5 | Files in this directory are generated from *greet.proto*: 6 | 7 | * *greet_grpc_web_pb.js* contains the gRPC-Web client. 8 | * *greet_pb.js* contains gRPC messages. 9 | 10 | Example of using `protoc` from PowerShell (`protoc` and `protoc-gen-grpc-web` should be on your computer and discoverable from your PATH): 11 | 12 | > protoc greet.proto --js_out=import_style=commonjs:CHANGE_TO_SCRIPTS_DIRECTORY --grpc-web_out=import_style=commonjs,mode=grpcwebtext:CHANGE_TO_SCRIPTS_DIRECTORY --plugin=protoc-gen-grpc-web=CHANGE_TO_PROTOC_GEN_GRPC_WEB_EXE_PATH 13 | -------------------------------------------------------------------------------- /perf/Grpc.AspNetCore.Microbenchmarks/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Grpc.AspNetCore.Microbenchmarks; 20 | 21 | [assembly: DefaultCoreConfigAttribute] -------------------------------------------------------------------------------- /startvs.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | :: This command launches a Visual Studio solution with environment variables required to use a local version of the .NET Core SDK. 4 | 5 | :: This tells .NET Core to use the same dotnet.exe that build scripts use 6 | SET DOTNET_ROOT=%~dp0.dotnet 7 | 8 | :: This tells .NET Core not to go looking for .NET Core in other places 9 | SET DOTNET_MULTILEVEL_LOOKUP=0 10 | 11 | :: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use 12 | SET PATH=%DOTNET_ROOT%;%PATH% 13 | 14 | SET sln=%1 15 | 16 | IF "%sln%"=="" ( 17 | SET sln=Grpc.DotNet.slnx 18 | ) 19 | 20 | IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" ( 21 | echo .NET Core has not yet been installed. Run `%~dp0build\get-dotnet.ps1` to install tools and activate the environment with `. %~dp0activate.ps1` 22 | exit /b 1 23 | ) 24 | 25 | start %sln% 26 | -------------------------------------------------------------------------------- /perf/benchmarkapps/GrpcClient/GrpcClientType.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace GrpcClient; 20 | 21 | public enum GrpcClientType 22 | { 23 | GrpcCore, 24 | GrpcNetClient 25 | } -------------------------------------------------------------------------------- /src/Grpc.Net.Client/Internal/IDebugger.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.Net.Client.Internal; 20 | 21 | internal interface IDebugger 22 | { 23 | bool IsAttached { get; } 24 | } 25 | -------------------------------------------------------------------------------- /testassets/FunctionalTestsWebsite/Infrastructure/DynamicService.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace FunctionalTestsWebsite.Infrastructure; 20 | 21 | public class DynamicService 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/Grpc.AspNetCore.Server/ServerServiceDefinitionMarker.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.AspNetCore.Server; 20 | 21 | internal sealed class ServerServiceDefinitionMarker 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/Grpc.Net.Client/Internal/ISystemClock.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.Net.Client.Internal; 20 | 21 | internal interface ISystemClock 22 | { 23 | DateTime UtcNow { get; } 24 | } 25 | -------------------------------------------------------------------------------- /testassets/Proto/race.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The gRPC Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package Race; 18 | 19 | service Racer { 20 | rpc ReadySetGo (stream RaceMessage) returns (stream RaceMessage); 21 | } 22 | 23 | message RaceMessage { 24 | int32 count = 1; 25 | } 26 | -------------------------------------------------------------------------------- /examples/Racer/Proto/race.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The gRPC Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package race; 18 | 19 | service Racer { 20 | rpc ReadySetGo (stream RaceMessage) returns (stream RaceMessage); 21 | } 22 | 23 | message RaceMessage { 24 | int32 count = 1; 25 | } 26 | -------------------------------------------------------------------------------- /examples/Tester/Server/Services/IGreeter.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | 20 | namespace Server 21 | { 22 | public interface IGreeter 23 | { 24 | string Greet(string name); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/Grpc.AspNetCore.Server.Tests/TestObjects/CustomMetadata.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | 20 | namespace Grpc.AspNetCore.Server.Tests.TestObjects; 21 | 22 | public class CustomMetadata 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /src/dotnet-grpc/Options/Access.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.Dotnet.Cli.Options; 20 | 21 | internal enum Access 22 | { 23 | // Default is Public 24 | Public = 0, 25 | Internal 26 | } 27 | -------------------------------------------------------------------------------- /examples/Tester/Client/IGreetRepository.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Client 20 | { 21 | public interface IGreetRepository 22 | { 23 | void SaveGreeting(string message); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Grpc.AspNetCore.Server/Internal/ISystemClock.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | 20 | namespace Grpc.AspNetCore.Server.Internal; 21 | 22 | internal interface ISystemClock 23 | { 24 | DateTime UtcNow { get; } 25 | } 26 | -------------------------------------------------------------------------------- /src/Grpc.Net.Client/Internal/Configuration/IConfigValue.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.Net.Client.Internal.Configuration; 20 | 21 | internal interface IConfigValue 22 | { 23 | object Inner { get; } 24 | } 25 | -------------------------------------------------------------------------------- /test/Grpc.AspNetCore.Server.Tests/Proto/race.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The gRPC Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package race; 18 | 19 | service Racer { 20 | rpc ReadySetGo (stream RaceMessage) returns (stream RaceMessage); 21 | } 22 | 23 | message RaceMessage { 24 | int32 count = 1; 25 | } 26 | -------------------------------------------------------------------------------- /examples/Browser/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | wwwroot\ 6 | $(DefaultItemExcludes);$(SpaRoot)node_modules\**;$(SpaRoot)dist\** 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/Grpc.AspNetCore.Server.Tests/TestObjects/Services/RaceServiceImpl.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.AspNetCore.Server.Tests.TestObjects; 20 | 21 | public class RaceServiceImpl : Race.Racer.RacerBase 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/Shared/IsExternalInit.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace System.Runtime.CompilerServices; 20 | 21 | #if NETCOREAPP3_0 || NETSTANDARD2_0_OR_GREATER || NET462 22 | internal static class IsExternalInit 23 | { 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /testassets/InteropTestsWebsite/README.md: -------------------------------------------------------------------------------- 1 | Running Grpc.Core interop client against Grpc.AspNetCore.Server interop server. 2 | Context: https://github.com/grpc/grpc/blob/master/doc/interop-test-descriptions.md 3 | 4 | ## Start the InteropTestsWebsite 5 | 6 | ``` 7 | # From this directory 8 | $ dotnet run 9 | Now listening on: http://localhost:50052 10 | ``` 11 | 12 | ## Build gRPC C# as a developer: 13 | Follow https://github.com/grpc/grpc/tree/master/src/csharp 14 | ``` 15 | python tools/run_tests/run_tests.py -l csharp -c dbg --build_only 16 | ``` 17 | 18 | ## Running the interop client 19 | 20 | ``` 21 | cd src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 22 | 23 | mono Grpc.IntegrationTesting.Client.exe --server_host=localhost --server_port=50052 --test_case=large_unary 24 | ``` 25 | 26 | NOTE: Currently the some tests will fail because not all the features are implemented 27 | by Grpc.AspNetCore.Server 28 | -------------------------------------------------------------------------------- /perf/benchmarkapps/GrpcAspNetCoreServer/RunGrpcServer.ps1: -------------------------------------------------------------------------------- 1 | Param 2 | ( 3 | [string]$protocol = "h2c", 4 | [string]$log_level = "None", 5 | [bool]$enable_cert_auth = $false, 6 | [bool]$publish_aot = $false 7 | ) 8 | 9 | # Command line example: 10 | # .\RunGrpcServer.ps1 -publish_aot $true 11 | 12 | Write-Host "Protocol: $protocol" -ForegroundColor Cyan 13 | Write-Host "Log level: $log_level" -ForegroundColor Cyan 14 | Write-Host "Enable cert auth: $enable_cert_auth" -ForegroundColor Cyan 15 | Write-Host "Publish AOT: $publish_aot" -ForegroundColor Cyan 16 | Write-Host 17 | 18 | dotnet publish -r win-x64 -c Release --self-contained --output bin\Publish -p:PublishAot=$publish_aot 19 | if ($LASTEXITCODE -ne 0) 20 | { 21 | exit; 22 | } 23 | 24 | .\bin\Publish\GrpcAspNetCoreServer.exe --protocol $protocol --logLevel $log_level --enableCertAuth $enable_cert_auth 25 | Write-Host 26 | 27 | Write-Host "Done" -ForegroundColor Cyan -------------------------------------------------------------------------------- /examples/Blazor/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /examples/Retrier/Proto/retry.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The gRPC Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package retry; 18 | 19 | service Retrier { 20 | rpc DeliverPackage (Package) returns (Response); 21 | } 22 | 23 | message Package { 24 | string name = 1; 25 | } 26 | 27 | message Response { 28 | string message = 1; 29 | } 30 | -------------------------------------------------------------------------------- /src/dotnet-grpc/Internal/CLIToolException.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | 20 | namespace Grpc.Dotnet.Cli.Internal; 21 | 22 | internal sealed class CLIToolException : Exception 23 | { 24 | public CLIToolException(string message) : base(message) { } 25 | } 26 | -------------------------------------------------------------------------------- /src/dotnet-grpc/Options/Services.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.Dotnet.Cli.Options; 20 | 21 | internal enum Services 22 | { 23 | // Default is Both 24 | Default = 0, 25 | Both, 26 | Server, 27 | Client, 28 | None 29 | } 30 | -------------------------------------------------------------------------------- /testassets/InteropTestsNativeServer/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace InteropTestsNativeWebsite; 20 | 21 | public class Program 22 | { 23 | public static void Main(string[] args) 24 | { 25 | InteropServer.Run(args); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /testassets/Proto/nested.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The gRPC Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package nested; 18 | 19 | service NestedService { 20 | rpc SayHello (HelloRequest) returns (HelloReply); 21 | } 22 | 23 | message HelloRequest { 24 | string name = 1; 25 | } 26 | 27 | message HelloReply { 28 | string message = 1; 29 | } 30 | -------------------------------------------------------------------------------- /examples/Error/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server; 20 | 21 | var builder = WebApplication.CreateBuilder(args); 22 | builder.Services.AddGrpc(); 23 | 24 | var app = builder.Build(); 25 | app.MapGrpcService(); 26 | 27 | app.Run(); 28 | -------------------------------------------------------------------------------- /examples/Liber/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server; 20 | 21 | var builder = WebApplication.CreateBuilder(args); 22 | builder.Services.AddGrpc(); 23 | 24 | var app = builder.Build(); 25 | app.MapGrpcService(); 26 | 27 | app.Run(); 28 | -------------------------------------------------------------------------------- /examples/Racer/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server; 20 | 21 | var builder = WebApplication.CreateBuilder(args); 22 | builder.Services.AddGrpc(); 23 | 24 | var app = builder.Build(); 25 | app.MapGrpcService(); 26 | 27 | app.Run(); 28 | -------------------------------------------------------------------------------- /examples/Greeter/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server; 20 | 21 | var builder = WebApplication.CreateBuilder(args); 22 | builder.Services.AddGrpc(); 23 | 24 | var app = builder.Build(); 25 | app.MapGrpcService(); 26 | 27 | app.Run(); 28 | -------------------------------------------------------------------------------- /examples/Retrier/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server; 20 | 21 | var builder = WebApplication.CreateBuilder(args); 22 | builder.Services.AddGrpc(); 23 | 24 | var app = builder.Build(); 25 | app.MapGrpcService(); 26 | 27 | app.Run(); 28 | -------------------------------------------------------------------------------- /examples/Uploader/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server; 20 | 21 | var builder = WebApplication.CreateBuilder(args); 22 | builder.Services.AddGrpc(); 23 | 24 | var app = builder.Build(); 25 | app.MapGrpcService(); 26 | 27 | app.Run(); 28 | -------------------------------------------------------------------------------- /examples/Channeler/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server; 20 | 21 | var builder = WebApplication.CreateBuilder(args); 22 | builder.Services.AddGrpc(); 23 | 24 | var app = builder.Build(); 25 | app.MapGrpcService(); 26 | 27 | app.Run(); 28 | -------------------------------------------------------------------------------- /examples/Downloader/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server; 20 | 21 | var builder = WebApplication.CreateBuilder(args); 22 | builder.Services.AddGrpc(); 23 | 24 | var app = builder.Build(); 25 | app.MapGrpcService(); 26 | 27 | app.Run(); 28 | -------------------------------------------------------------------------------- /examples/Frameworker/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server; 20 | 21 | var builder = WebApplication.CreateBuilder(args); 22 | builder.Services.AddGrpc(); 23 | 24 | var app = builder.Build(); 25 | app.MapGrpcService(); 26 | 27 | app.Run(); 28 | -------------------------------------------------------------------------------- /examples/Locator/Proto/external.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The gRPC Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greet; 18 | 19 | service External { 20 | rpc SayHello (ExternalRequest) returns (ExternalReply); 21 | } 22 | 23 | message ExternalRequest { 24 | string name = 1; 25 | } 26 | 27 | message ExternalReply { 28 | string message = 1; 29 | } 30 | -------------------------------------------------------------------------------- /examples/Locator/Proto/internal.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The gRPC Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greet; 18 | 19 | service Internal { 20 | rpc SayHello (InternalRequest) returns (InternalReply); 21 | } 22 | 23 | message InternalRequest { 24 | string name = 1; 25 | } 26 | 27 | message InternalReply { 28 | string message = 1; 29 | } 30 | -------------------------------------------------------------------------------- /examples/Progressor/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server; 20 | 21 | var builder = WebApplication.CreateBuilder(args); 22 | builder.Services.AddGrpc(); 23 | 24 | var app = builder.Build(); 25 | app.MapGrpcService(); 26 | 27 | app.Run(); 28 | -------------------------------------------------------------------------------- /examples/Tester/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server; 20 | 21 | var host = Host.CreateDefaultBuilder(args) 22 | .ConfigureWebHostDefaults(webBuilder => 23 | { 24 | webBuilder.UseStartup(); 25 | }).Build(); 26 | 27 | host.Run(); 28 | -------------------------------------------------------------------------------- /examples/Blazor/Proto/count.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The gRPC Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package count; 18 | 19 | service Counter { 20 | rpc StartCounter (CounterRequest) returns (stream CounterResponse); 21 | } 22 | 23 | message CounterRequest { 24 | int32 start = 1; 25 | } 26 | 27 | message CounterResponse { 28 | int32 count = 1; 29 | } 30 | -------------------------------------------------------------------------------- /docfx/README.md: -------------------------------------------------------------------------------- 1 | DocFX-generated C# API Reference 2 | -------------------------------- 3 | 4 | ## Generating docs manually (on Windows) 5 | 6 | Install docfx based on instructions here: https://github.com/dotnet/docfx 7 | 8 | ``` 9 | # generate docfx documentation into ./html directory 10 | $ docfx 11 | 12 | # view the resulting docs 13 | $ docfx server html 14 | ``` 15 | 16 | ## Release process: script for regenerating the docs automatically 17 | 18 | After each gRPC C# release, the docs need to be regenerated 19 | and updated on the grpc.io site. The automated script will 20 | re-generate the docs (using dockerized docfx installation) 21 | and make everything ready for creating a PR to update the docs. 22 | 23 | ``` 24 | # 1. Run the script on Linux with docker installed 25 | $ ./generate_reference_docs.sh 26 | 27 | # 2. Enter the git repo with updated "gh-pages" branch 28 | $ cd grpc-gh-pages 29 | 30 | # 3. Review the changes and create a pull request 31 | ``` 32 | -------------------------------------------------------------------------------- /test/Shared/Logging/TestLoggerFactory.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #nullable disable 5 | 6 | // Copied with permission from https://github.com/dotnet/aspnetcore/tree/08b60af1bca8cffff8ba0a72164fb7505ffe114d/src/Testing/src/Logging 7 | namespace Microsoft.Extensions.Logging.Testing; 8 | 9 | public class TestLoggerFactory : ILoggerFactory 10 | { 11 | private readonly ITestSink _sink; 12 | private readonly bool _enabled; 13 | 14 | public TestLoggerFactory(ITestSink sink, bool enabled) 15 | { 16 | _sink = sink; 17 | _enabled = enabled; 18 | } 19 | 20 | public ILogger CreateLogger(string name) 21 | { 22 | return new TestLogger(name, _sink, _enabled); 23 | } 24 | 25 | public void AddProvider(ILoggerProvider provider) 26 | { 27 | } 28 | 29 | public void Dispose() 30 | { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /examples/Aggregator/Proto/aggregate.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The gRPC Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | import "count.proto"; 18 | import "greet.proto"; 19 | 20 | package aggregate; 21 | 22 | service Aggregator { 23 | rpc AccumulateCount (stream count.CounterRequest) returns (count.CounterReply); 24 | rpc SayHellos (greet.HelloRequest) returns (stream greet.HelloReply); 25 | } -------------------------------------------------------------------------------- /examples/Aggregator/Server/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/Grpc.AspNetCore.Server.Tests/TestObjects/Services/WithAttribute/GreeterWithAttributeService.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.AspNetCore.Server.Tests.TestObjects.Services.WithAttribute; 20 | 21 | public class GreeterWithAttributeService : GreeterWithAttribute.GreeterBase 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /examples/Coder/Shared/HelloReply.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using System.Runtime.Serialization; 20 | 21 | namespace Shared 22 | { 23 | [DataContract] 24 | public class HelloReply 25 | { 26 | [DataMember(Order = 1)] 27 | public string? Message { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/Coder/Shared/HelloRequest.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using System.Runtime.Serialization; 20 | 21 | namespace Shared 22 | { 23 | [DataContract] 24 | public class HelloRequest 25 | { 26 | [DataMember(Order = 1)] 27 | public string? Name { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /kokoro/interop.cfg: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The gRPC Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Config file for the internal CI (in protobuf text format) 16 | 17 | # Location of the continuous shell script in repository. 18 | build_file: "grpc-dotnet/kokoro/interop.sh" 19 | timeout_mins: 30 20 | 21 | action { 22 | define_artifacts { 23 | regex: "**/*sponge_log.*" 24 | regex: "github/grpc-dotnet/artifacts/**" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /kokoro/linux.cfg: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The gRPC Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Config file for the internal CI (in protobuf text format) 16 | 17 | # Location of the continuous shell script in repository. 18 | build_file: "grpc-dotnet/kokoro/build_nuget.sh" 19 | timeout_mins: 30 20 | 21 | action { 22 | define_artifacts { 23 | regex: "**/*sponge_log.*" 24 | regex: "github/grpc-dotnet/artifacts/**" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Grpc.Net.ClientFactory/Internal/GrpcClientMappingRegistry.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.Net.ClientFactory.Internal; 20 | 21 | internal class GrpcClientMappingRegistry 22 | { 23 | public Dictionary NamedClientRegistrations { get; } = new Dictionary(); 24 | } 25 | -------------------------------------------------------------------------------- /test/FunctionalTests/Infrastructure/TestConstants.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.AspNetCore.FunctionalTests.Infrastructure; 20 | 21 | internal static class TestConstants 22 | { 23 | public const string ServerCallHandlerTestName = "SERVER Grpc.AspNetCore.Server.ServerCallHandler"; 24 | } 25 | -------------------------------------------------------------------------------- /src/Grpc.Net.Client/Internal/SystemClock.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.Net.Client.Internal; 20 | 21 | internal sealed class SystemClock : ISystemClock 22 | { 23 | public static readonly SystemClock Instance = new SystemClock(); 24 | 25 | public DateTime UtcNow => DateTime.UtcNow; 26 | } 27 | -------------------------------------------------------------------------------- /test/Grpc.AspNetCore.Server.Tests/TestObjects/Services/WithAttribute/GreeterWithAttributeServiceSubClass.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.AspNetCore.Server.Tests.TestObjects.Services.WithAttribute; 20 | 21 | public class GreeterWithAttributeServiceSubClass : GreeterWithAttributeService 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /kokoro/build_nuget.cfg: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The gRPC Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Config file for the internal CI (in protobuf text format) 16 | 17 | # Location of the continuous shell script in repository. 18 | build_file: "grpc-dotnet/kokoro/build_nuget.sh" 19 | timeout_mins: 30 20 | 21 | action { 22 | define_artifacts { 23 | regex: "**/*sponge_log.*" 24 | regex: "github/grpc-dotnet/artifacts/**" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/Grpc.AspNetCore.Server.Tests/TestObjects/Services/WithoutAttribute/GreeterWithoutAttributeService.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.AspNetCore.Server.Tests.TestObjects.Services.WithoutAttribute; 20 | 21 | public class GreeterWithoutAttributeService : GreeterWithoutAttribute.GreeterBase 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /testassets/Proto/chat.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The gRPC Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package chat; 18 | 19 | // The greeting service definition. 20 | service Chatter { 21 | // Sends a greeting 22 | rpc Chat (stream ChatMessage) returns (stream ChatMessage); 23 | } 24 | 25 | // The chat message. 26 | message ChatMessage { 27 | string name = 1; 28 | string message = 2; 29 | } 30 | -------------------------------------------------------------------------------- /test/Grpc.Net.Client.Tests/Infrastructure/Http2StreamException.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | #if !NET7_0_OR_GREATER 20 | namespace System.Net.Http; 21 | 22 | public class Http2StreamException : Exception 23 | { 24 | public Http2StreamException(string message) : base(message) 25 | { 26 | } 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /TROUBLESHOOTING.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting gRPC for .NET 2 | 3 | This guide is for troubleshooting gRPC for .NET (grpc-dotnet). For issues specific to Grpc.Core (C-core server and client), or code generation with Grpc.Tools, please refer to [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) in `grpc/grpc` repository. 4 | 5 | ## Troubleshooting documentation 6 | 7 | For solutions for commonly encountered problems, see [gRPC troubleshooting](https://docs.microsoft.com/aspnet/core/grpc/troubleshoot). 8 | 9 | ## Answers on StackOverflow 10 | 11 | Your problem might have already been solved on StackOverflow. Search for questions with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc 12 | 13 | ## Enabling extra logging and tracing 14 | 15 | Extra logging can be very useful for diagnosing problems. For documentation on configuring logging in gRPC services and clients, see 16 | [Logging and diagnostics in gRPC on .NET](https://docs.microsoft.com/aspnet/core/grpc/diagnostics). 17 | -------------------------------------------------------------------------------- /examples/Certifier/Proto/certify.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The gRPC Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | import "google/protobuf/empty.proto"; 18 | 19 | package certify; 20 | 21 | service Certifier { 22 | rpc GetCertificateInfo (google.protobuf.Empty) returns (CertificateInfoResponse); 23 | } 24 | 25 | message CertificateInfoResponse { 26 | bool hasCertificate = 1; 27 | string name = 2; 28 | } 29 | -------------------------------------------------------------------------------- /examples/Mailer/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server; 20 | 21 | var builder = WebApplication.CreateBuilder(args); 22 | builder.Services.AddGrpc(); 23 | builder.Services.AddSingleton(); 24 | 25 | var app = builder.Build(); 26 | app.MapGrpcService(); 27 | 28 | app.Run(); 29 | -------------------------------------------------------------------------------- /examples/Worker/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server; 20 | 21 | var builder = WebApplication.CreateBuilder(args); 22 | builder.Services.AddGrpc(); 23 | builder.Services.AddSingleton(); 24 | 25 | var app = builder.Build(); 26 | app.MapGrpcService(); 27 | 28 | app.Run(); 29 | -------------------------------------------------------------------------------- /src/Grpc.AspNetCore.Server/Internal/SystemClock.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.AspNetCore.Server.Internal; 20 | 21 | internal sealed class SystemClock : ISystemClock 22 | { 23 | public static readonly SystemClock Instance = new SystemClock(); 24 | 25 | public DateTime UtcNow => DateTime.UtcNow; 26 | } 27 | -------------------------------------------------------------------------------- /test/Grpc.AspNetCore.Server.Tests/TestObjects/Services/WithAttribute/GreeterWithAttributeServiceSubSubClass.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.AspNetCore.Server.Tests.TestObjects.Services.WithAttribute; 20 | 21 | public class GreeterWithAttributeServiceSubSubClass : GreeterWithAttributeServiceSubClass 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /test/Grpc.AspNetCore.Server.Tests/TestObjects/Services/WithoutAttribute/GreeterWithoutAttributeServiceSubClass.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.AspNetCore.Server.Tests.TestObjects.Services.WithoutAttribute; 20 | 21 | public class GreeterWithoutAttributeServiceSubClass : GreeterWithoutAttributeService 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /examples/Counter/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server; 20 | 21 | var builder = WebApplication.CreateBuilder(args); 22 | builder.Services.AddGrpc(); 23 | builder.Services.AddSingleton(); 24 | 25 | var app = builder.Build(); 26 | app.MapGrpcService(); 27 | 28 | app.Run(); 29 | -------------------------------------------------------------------------------- /test/FunctionalTests/Infrastructure/TestServerEndpointName.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.AspNetCore.FunctionalTests.Infrastructure; 20 | 21 | public enum TestServerEndpointName 22 | { 23 | Http2, 24 | Http1, 25 | Http2WithTls, 26 | Http1WithTls, 27 | UnixDomainSocket, 28 | Http3WithTls, 29 | } 30 | -------------------------------------------------------------------------------- /test/Shared/Logging/ITestSink.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | #nullable disable 5 | 6 | using System; 7 | using System.Collections.Concurrent; 8 | 9 | // Copied with permission from https://github.com/dotnet/aspnetcore/tree/08b60af1bca8cffff8ba0a72164fb7505ffe114d/src/Testing/src/Logging 10 | namespace Microsoft.Extensions.Logging.Testing; 11 | 12 | public interface ITestSink 13 | { 14 | event Action MessageLogged; 15 | 16 | event Action ScopeStarted; 17 | 18 | Func WriteEnabled { get; set; } 19 | 20 | Func BeginEnabled { get; set; } 21 | 22 | IProducerConsumerCollection Scopes { get; set; } 23 | 24 | IProducerConsumerCollection Writes { get; set; } 25 | 26 | void Write(WriteContext context); 27 | 28 | void Begin(BeginScopeContext context); 29 | } 30 | -------------------------------------------------------------------------------- /examples/Aggregator/Server/IncrementingCounter.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Server 20 | { 21 | public class IncrementingCounter 22 | { 23 | public void Increment(int amount) 24 | { 25 | Count += amount; 26 | } 27 | 28 | public int Count { get; private set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /examples/Coder/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using ProtoBuf.Grpc.Server; 20 | using Server; 21 | 22 | var builder = WebApplication.CreateBuilder(args); 23 | builder.Services.AddGrpc(); 24 | builder.Services.AddCodeFirstGrpc(); 25 | 26 | var app = builder.Build(); 27 | app.MapGrpcService(); 28 | 29 | app.Run(); -------------------------------------------------------------------------------- /examples/Container/Backend/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server.Services; 20 | 21 | var builder = WebApplication.CreateBuilder(args); 22 | builder.Logging.SetMinimumLevel(LogLevel.Trace); 23 | builder.Services.AddGrpc(); 24 | 25 | var app = builder.Build(); 26 | app.MapGrpcService(); 27 | 28 | app.Run(); 29 | -------------------------------------------------------------------------------- /examples/Container/Frontend/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.AspNetCore.Mvc.RazorPages; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Frontend.Pages 11 | { 12 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 13 | [IgnoreAntiforgeryToken] 14 | public class ErrorModel : PageModel 15 | { 16 | public string? RequestId { get; set; } 17 | 18 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 19 | 20 | private readonly ILogger _logger; 21 | 22 | public ErrorModel(ILogger logger) 23 | { 24 | _logger = logger; 25 | } 26 | 27 | public void OnGet() 28 | { 29 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /examples/Counter/Server/IncrementingCounter.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Server 20 | { 21 | public class IncrementingCounter 22 | { 23 | public void Increment(int amount) 24 | { 25 | Count += amount; 26 | } 27 | 28 | public int Count { get; private set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /examples/Worker/Server/IncrementingCounter.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Server 20 | { 21 | public class IncrementingCounter 22 | { 23 | public void Increment(int amount) 24 | { 25 | Count += amount; 26 | } 27 | 28 | public int Count { get; private set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Grpc.Auth/Grpc.Auth.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | gRPC C# Authentication Library 4 | gRPC RPC HTTP/2 Auth OAuth2 5 | 6 | true 7 | true 8 | net462;netstandard2.0 9 | README.md 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /test/Grpc.Net.Client.Tests/Infrastructure/QuicStreamAbortedException.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | #if !NET7_0_OR_GREATER 20 | namespace System.Net.Quic; 21 | 22 | public class QuicStreamAbortedException : Exception 23 | { 24 | public QuicStreamAbortedException(string message) : base(message) 25 | { 26 | } 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /examples/Compressor/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server; 20 | 21 | var builder = WebApplication.CreateBuilder(args); 22 | builder.Services.AddGrpc(o => 23 | { 24 | o.ResponseCompressionAlgorithm = "gzip"; 25 | }); 26 | 27 | var app = builder.Build(); 28 | app.MapGrpcService(); 29 | 30 | app.Run(); 31 | -------------------------------------------------------------------------------- /perf/Grpc.AspNetCore.Microbenchmarks/Proto/chat.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The gRPC Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package chat; 18 | 19 | // The greeting service definition. 20 | service Chatter { 21 | // Sends a greeting 22 | rpc Chat (stream ChatMessage) returns (stream ChatMessage); 23 | } 24 | 25 | // The chat message. 26 | message ChatMessage { 27 | string name = 1; 28 | string message = 2; 29 | } 30 | -------------------------------------------------------------------------------- /test/Grpc.AspNetCore.Server.Tests/TestObjects/Services/WithoutAttribute/GreeterWithoutAttributeServiceSubSubClass.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.AspNetCore.Server.Tests.TestObjects.Services.WithoutAttribute; 20 | 21 | public class GreeterWithoutAttributeServiceSubSubClass : GreeterWithoutAttributeServiceSubClass 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /testassets/Proto/unimplemented.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The gRPC Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package unimplemented; 18 | 19 | // No service is registered on the server so methods will return unimplemented 20 | service UnimplementedService { 21 | rpc DuplexData (stream UnimplementeDataMessage) returns (stream UnimplementeDataMessage); 22 | } 23 | 24 | message UnimplementeDataMessage { 25 | bytes data = 1; 26 | } -------------------------------------------------------------------------------- /examples/Reflector/Server/Program.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | using Server; 20 | 21 | var builder = WebApplication.CreateBuilder(args); 22 | builder.Services.AddGrpc(); 23 | builder.Services.AddGrpcReflection(); 24 | 25 | var app = builder.Build(); 26 | app.MapGrpcService(); 27 | app.MapGrpcReflectionService(); 28 | 29 | app.Run(); 30 | -------------------------------------------------------------------------------- /testassets/FunctionalTestsWebsite/Infrastructure/IncrementingCounter.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace FunctionalTestsWebsite.Infrastructure; 20 | 21 | public class IncrementingCounter 22 | { 23 | public void Increment(int amount) 24 | { 25 | Count += amount; 26 | } 27 | 28 | public int Count { get; private set; } 29 | } 30 | -------------------------------------------------------------------------------- /testassets/Proto/authorize.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The gRPC Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package authorize; 18 | 19 | // The greeting service definition. 20 | service AuthorizedGreeter { 21 | rpc SayHello (HelloRequest) returns (HelloReply); 22 | } 23 | 24 | message HelloRequest { 25 | string name = 1; 26 | } 27 | 28 | message HelloReply { 29 | string message = 1; 30 | map claims = 2; 31 | } 32 | -------------------------------------------------------------------------------- /examples/Blazor/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:59193/", 7 | "sslPort": 44375 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "Server": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | }, 26 | "applicationUrl": "https://localhost:5001;http://localhost:5000" 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Grpc.AspNetCore.Web/Internal/ServerGrpcWebMode.cs: -------------------------------------------------------------------------------- 1 | #region Copyright notice and license 2 | 3 | // Copyright 2019 The gRPC Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #endregion 18 | 19 | namespace Grpc.AspNetCore.Web.Internal; 20 | 21 | internal readonly record struct ServerGrpcWebContext(ServerGrpcWebMode Request, ServerGrpcWebMode Response); 22 | 23 | internal enum ServerGrpcWebMode : byte 24 | { 25 | None, 26 | GrpcWeb, 27 | GrpcWebText 28 | } 29 | --------------------------------------------------------------------------------