![]() |
VOOZH | about |
dotnet add package ServiceModel.Grpc.AspNetCore --version 1.23.0
NuGet\Install-Package ServiceModel.Grpc.AspNetCore -Version 1.23.0
<PackageReference Include="ServiceModel.Grpc.AspNetCore" Version="1.23.0" />
<PackageVersion Include="ServiceModel.Grpc.AspNetCore" Version="1.23.0" />Directory.Packages.props
<PackageReference Include="ServiceModel.Grpc.AspNetCore" />Project file
paket add ServiceModel.Grpc.AspNetCore --version 1.23.0
#r "nuget: ServiceModel.Grpc.AspNetCore, 1.23.0"
#:package ServiceModel.Grpc.AspNetCore@1.23.0
#addin nuget:?package=ServiceModel.Grpc.AspNetCore&version=1.23.0Install as a Cake Addin
#tool nuget:?package=ServiceModel.Grpc.AspNetCore&version=1.23.0Install as a Cake Tool
ServiceModel.Grpc enables applications to communicate with gRPC services using a code-first approach (no .proto files), helps to get around limitations of gRPC protocol like "only reference types", "exact one input", "no nulls", "no value-types". Provides exception handling. Helps to migrate existing WCF solution to gRPC with minimum effort.
ServiceModel.Grpc.AspNetCore is package with code-first extensions for Grpc.AspNetCore.Server.
A service contract is an interface decorated with the ServiceContract attribute. Interface methods decorated with the OperationContract attribute are treated as gRPC operations.
For example, following ICalculator contract with unary Sum operation and client streaming MultiplyBy operation:
[ServiceContract]
public interface ICalculator
{
[OperationContract]
Task<long> Sum(long x, int y, int z, CancellationToken token = default);
[OperationContract]
ValueTask<(int Multiplier, IAsyncEnumerable<int> Values)> MultiplyBy(IAsyncEnumerable<int> values, int multiplier, CancellationToken token = default);
}
internal sealed class Calculator : ICalculator
{
public Task<long> Sum(long x, int y, int z, CancellationToken token) => x + y + z;
public ValueTask<(int Multiplier, IAsyncEnumerable<int> Values)> MultiplyBy(IAsyncEnumerable<int> values, int multiplier, CancellationToken token)
{
var multiplicationResult = DoMultiplication(values, multiplier, token);
return new ValueTask<(int, IAsyncEnumerable<int>)>((multiplier, multiplicationResult));
}
private static async IAsyncEnumerable<int> DoMultiplication(IAsyncEnumerable<int> values, int multiplier, [EnumeratorCancellation] CancellationToken token)
{
await foreach (var value in values.WithCancellation(token))
{
yield return value * multiplier;
}
}
}
Enable ServiceModel.Grpc code-first and add service to the routing pipeline.
var builder = WebApplication.CreateBuilder();
// optional Grpc.AspNetCore.Server configuration
builder.Services.AddGrpc(options =>
{
// ...
});
// enable ServiceModel.Grpc code-first
builder.Services.AddServiceModelGrpc(options =>
{
options.DefaultMarshallerFactory = ...
options.DefaultErrorHandlerFactory = ...
options.Filters = ...
});
var app = builder.Build();
// bind the service
app.MapGrpcService<Calculator>();
app.Run();
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on ServiceModel.Grpc.AspNetCore:
| Package | Downloads |
|---|---|
|
ServiceModel.Grpc.AspNetCore.Swashbuckle
Library that enables applications to communicate with gRPC services using code-first approach, helps to get around some limitations of gRPC protocol. Provides exception handling. Helps to migrate existing WCF solution to gRPC with minimum effort. |
|
|
ServiceModel.Grpc.AspNetCore.NSwag
Library that enables applications to communicate with gRPC services using code-first approach, helps to get around some limitations of gRPC protocol. Provides exception handling. Helps to migrate existing WCF solution to gRPC with minimum effort. |
|
|
MF40.Silo
Orleans Silo |
|
|
AbrPlus.Integration.OpenERP.Hosting
Copyright © AbrPlus 2024 |
|
|
CleanTemplate.Grpc
A Clean Architecture Base Template comprising all Baseic and Abstract and Contract types for Grpc Communication. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.23.0 | 3,585 | 5/17/2026 |
| 1.22.1 | 2,010 | 4/3/2026 |
| 1.22.0 | 251 | 3/29/2026 |
| 1.21.0 | 9,289 | 12/21/2025 |
| 1.20.0 | 2,637 | 11/23/2025 |
| 1.19.0 | 2,985 | 11/9/2025 |
| 1.18.0 | 3,287 | 10/2/2025 |
| 1.17.0 | 4,382 | 8/31/2025 |
| 1.16.0 | 3,782 | 6/29/2025 |
| 1.15.0 | 1,580 | 6/15/2025 |
| 1.14.0 | 5,714 | 4/18/2025 |
| 1.13.0 | 4,240 | 2/2/2025 |
| 1.12.0 | 1,212 | 1/12/2025 |
| 1.11.1 | 1,814 | 11/30/2024 |
| 1.11.0 | 3,141 | 11/23/2024 |
| 1.10.1 | 35,126 | 10/19/2024 |
| 1.9.1 | 2,594 | 9/29/2024 |
| 1.9.0 | 18,057 | 7/21/2024 |
| 1.8.3 | 15,575 | 5/18/2024 |