From bd6101158afc0a844c4eb1372b40de18fe54d632 Mon Sep 17 00:00:00 2001 From: forsthug <85173816+forsthug@users.noreply.github.com> Date: Fri, 26 Jan 2024 07:57:52 +0100 Subject: [PATCH] remove grpc warnings --- .../Extensions/LoggerConfigurationExtensions.cs | 2 +- src/fiskaltrust.Launcher/Services/HostingService.cs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/fiskaltrust.Launcher.Common/Extensions/LoggerConfigurationExtensions.cs b/src/fiskaltrust.Launcher.Common/Extensions/LoggerConfigurationExtensions.cs index 03c739d9..5f13253c 100644 --- a/src/fiskaltrust.Launcher.Common/Extensions/LoggerConfigurationExtensions.cs +++ b/src/fiskaltrust.Launcher.Common/Extensions/LoggerConfigurationExtensions.cs @@ -25,7 +25,7 @@ public static LoggerConfiguration AddLoggingConfiguration(this LoggerConfigurati .MinimumLevel.Override("Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware", aspLogging ? LogEventLevel.Information : LogEventLevel.Warning) .MinimumLevel.Override("System", LogEventLevel.Warning) .MinimumLevel.Override("Grpc", LogEventLevel.Warning) - .MinimumLevel.Override("ProtoBuf", LogEventLevel.Warning); + .MinimumLevel.Override("ProtoBuf", LogEventLevel.Error); return loggerConfiguration; } diff --git a/src/fiskaltrust.Launcher/Services/HostingService.cs b/src/fiskaltrust.Launcher/Services/HostingService.cs index 7380cc4d..af28d402 100644 --- a/src/fiskaltrust.Launcher/Services/HostingService.cs +++ b/src/fiskaltrust.Launcher/Services/HostingService.cs @@ -19,6 +19,7 @@ using System.Runtime.Versioning; using Microsoft.AspNetCore.Server.HttpSys; using System.Text.Json; +using fiskaltrust.ifPOS.v0; namespace fiskaltrust.Launcher.Services { @@ -249,6 +250,12 @@ private WebApplication CreateGrpcHost(WebApplicationBuilder builder, Uri uri, _logger.LogWarning($"{nameof(_launcherConfiguration.UseHttpSysBinding)} is not supported for grpc."); } + ProtoBuf.Meta.RuntimeTypeModel.Default.Add(typeof(IAsyncResult), true); + ProtoBuf.Meta.RuntimeTypeModel.Default.Add(typeof(AsyncCallback), true); + ProtoBuf.Meta.RuntimeTypeModel.Default.Add(typeof(Stream), true); + ProtoBuf.Meta.RuntimeTypeModel.Default.GetSchema(typeof(IPOS)); + ProtoBuf.Meta.RuntimeTypeModel.Default.Add(typeof(IPOS), true).AddSubType(1, typeof(ifPOS.v1.IPOS)); + builder.WebHost.BindKestrel(uri, listenOptions => ConfigureTls(listenOptions), false, HttpProtocols.Http2); builder.Services.AddCodeFirstGrpc(options => options.EnableDetailedErrors = true); builder.Services.AddSingleton(instance);