Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

grpc-dotnet Server without ASP.Net

I am currently trying to port my Project (.Net Core) from "Grpc.Core" to "grpc-dotnet", since Grpc.Core is now in maintenance mode and will be deprecated in about a Year.

The Projects consists of multiple services. Clients and Servers.

Porting the Client part was no problem, but how do i create a Server with grpc-dotnet without Asp.Net ?

The current implementation looks as follows

using Grpc.Core;
using ProtoBuf.Grpc.Server;

...

private Grpc.Core.Server CreateServer()
{
    Server server = new Server
    {
        Ports = {new ServerPort(_Configuration.Host, _Configuration.Port, ServerCredentials.Insecure)}
    };
    
    return server;
}

The Services provided by the Server are registered Code-First with ProtoBuf.Grpc.Server.

Are Servers outside of Asp.Net supported or will be supported ?

like image 358
xTeare Avatar asked Feb 15 '26 05:02

xTeare


1 Answers

I desperately wish it were otherwise, but I'm afraid the answer is that you can't. This gets asked pretty regularly (https://github.com/grpc/grpc-dotnet/issues/1368, https://github.com/grpc/grpc-dotnet/issues/1419).

From James Newton-King:

No there won't be support for .NET Framework server in grpc-dotnet. The new server implementation is built on ASP.NET Core and requires HTTP/2 support that is only available in .NET Core 3 or later.

like image 114
Patrick Stevens Avatar answered Feb 17 '26 22:02

Patrick Stevens