Can grpc service be hosted in .Net Framework or .Net Standard

Viewed 1711

I grabbed grpc server example online, and was able to start the server (in .net core) and create a client that could hit the endpoint. However, I was trying to change my server to point to .net framework (or .net standard) instead, but I cannot figure out how to get the server code to compile. I get an error when trying to use the same method ConfigureWebHostDefaults because I believe it is a .net core functionality only:

 public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .ConfigureWebHostDefaults(webBuilder =>
            {

                webBuilder.ConfigureKestrel(options =>
                {
                    // This endpoint will use HTTP/2 and HTTPS on port 5001.
                    options.Listen(IPAddress.Any, 5001, listenOptions =>
                    {
                        listenOptions.Protocols = HttpProtocols.Http2;
                    });
                });

                webBuilder.UseStartup<Startup>();
            });

Is what I'm trying to do possible? If so, are there any examples of how to start the server using .net standard/framework?

0 Answers
Related