StackSpot.Grpc
1.0.1
dotnet add package StackSpot.Grpc --version 1.0.1
NuGet\Install-Package StackSpot.Grpc -Version 1.0.1
<PackageReference Include="StackSpot.Grpc" Version="1.0.1" />
paket add StackSpot.Grpc --version 1.0.1
#r "nuget: StackSpot.Grpc, 1.0.1"
// Install StackSpot.Grpc as a Cake Addin #addin nuget:?package=StackSpot.Grpc&version=1.0.1 // Install StackSpot.Grpc as a Cake Tool #tool nuget:?package=StackSpot.Grpc&version=1.0.1
StackSpot Grpc .NET Core
Componente foi projetado para padronizar a configuração do gRPC nas aplicações.
Versões .NET suportadas
Atualmente, este projeto oferece suporte a aplicativos destinados net5.0.
Uso
1. Adicione o pacote NuGet StackSpot.Grpc
ao seu projeto.
dotnet add package StackSpot.Grpc
2. Adicione ao seu IServiceCollection
via services.AddGrpcServer()
no Startup
da aplicação ou Program
.
services.AddGrpcServer();
3. Adicione ao seu IApplicationBuilder
via app.UseGrpc()
no Startup
da aplicação ou Program
.
Para facilitar o registro dos serviços gRPC descritos nos arquivos proto, fornecemos um método de extensão chamado MapGrpcServices
para IEndpointRouteBuilder
que realiza o registro de todos os serviços gRPC de um assembly. Ele pode ser chamado diretamente ou conforme exemplo abaixo:
app.UseGrpc(env, typeof(Startup).Assembly, Path.Combine(env.ContentRootPath, "Protos"))
Caso queira habilitar um endpoint /proto
para servir os arquivos proto do projeto inclua a configuração abaixo:
public void Configure(IApplicationBuilder app)
{
...
app.UseGrpcDirectoryBrownser(Path.Combine(HostEnviroment.ContentRootPath, "Protos"));
...
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net5.0
- Grpc.AspNetCore (>= 2.44.0)
- Grpc.AspNetCore.Server.Reflection (>= 2.44.0)
- Microsoft.AspNetCore (>= 2.2.0)
- Microsoft.AspNetCore.Server.IIS (>= 2.2.6)
- Microsoft.Extensions.DependencyInjection (>= 6.0.0)
- Microsoft.Extensions.Hosting (>= 6.0.1)
- System.DirectoryServices.Protocols (>= 6.0.1)
-
net6.0
- Grpc.AspNetCore (>= 2.44.0)
- Grpc.AspNetCore.Server.Reflection (>= 2.44.0)
- Microsoft.AspNetCore (>= 2.2.0)
- Microsoft.AspNetCore.Server.IIS (>= 2.2.6)
- Microsoft.Extensions.DependencyInjection (>= 6.0.0)
- Microsoft.Extensions.Hosting (>= 6.0.1)
- System.DirectoryServices.Protocols (>= 6.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.