Reputation: 141
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 ?
Upvotes: 14
Views: 3252
Reputation: 579
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).
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.
Upvotes: 3